Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
e97ac43e
Commit
e97ac43e
authored
Jul 11, 2018
by
Guilhem Saurel
Browse files
Dependencies: look for ROS’ packages.xml
parent
50f7caf1
Pipeline
#941
passed with stages
in 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/migrations/0022_dependency_ros.py
0 → 100644
View file @
e97ac43e
# Generated by Django 2.0.5 on 2018-07-11 16:54
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0021_dependency'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'dependency'
,
name
=
'ros'
,
field
=
models
.
BooleanField
(
default
=
False
),
),
]
rainboard/models.py
View file @
e97ac43e
...
...
@@ -232,6 +232,20 @@ class Project(Links, NamedModel, TimeStampedModel):
dependency
.
cmake
=
True
dependency
.
save
()
def
ros
(
self
):
filename
=
self
.
git_path
()
/
'package.xml'
if
not
filename
.
exists
():
return
with
filename
.
open
()
as
f
:
content
=
f
.
read
()
for
dependency
in
re
.
findall
(
r
'<run_depend>(\w+).*</run_depend>'
,
content
,
re
.
I
):
project
=
Project
.
objects
.
filter
(
models
.
Q
(
slug
=
dependency
)
|
models
.
Q
(
slug
=
dependency
.
replace
(
'_'
,
'-'
)))
if
project
.
exists
():
dependency
,
_
=
Dependency
.
objects
.
get_or_create
(
project
=
self
,
library
=
project
.
first
())
if
not
dependency
.
ros
:
dependency
.
ros
=
True
dependency
.
save
()
def
repos
(
self
):
return
self
.
repo_set
.
count
()
...
...
@@ -294,10 +308,10 @@ class Project(Links, NamedModel, TimeStampedModel):
return
images
.
order_by
(
Length
(
'robotpkg__name'
).
desc
()).
first
()
def
print_deps
(
self
):
return
mark_safe
(
', '
.
join
(
d
.
get_link
()
for
d
in
self
.
dependencies
.
all
()))
return
mark_safe
(
', '
.
join
(
d
.
library
.
get_link
()
for
d
in
self
.
dependencies
.
all
()))
def
print_rdeps
(
self
):
return
mark_safe
(
', '
.
join
(
d
.
get_link
()
for
d
in
self
.
rdeps
.
all
()))
return
mark_safe
(
', '
.
join
(
d
.
project
.
get_link
()
for
d
in
self
.
rdeps
.
all
()))
class
Repo
(
TimeStampedModel
):
...
...
@@ -763,6 +777,7 @@ class Dependency(models.Model):
library
=
models
.
ForeignKey
(
Project
,
on_delete
=
models
.
CASCADE
,
related_name
=
'rdeps'
)
robotpkg
=
models
.
BooleanField
(
default
=
False
)
# TODO NYI
cmake
=
models
.
BooleanField
(
default
=
False
)
ros
=
models
.
BooleanField
(
default
=
False
)
class
Meta
:
verbose_name_plural
=
'dependencies'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment