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
406247ff
Commit
406247ff
authored
Apr 28, 2019
by
Guilhem Saurel
Browse files
yapf
parent
596d37dc
Pipeline
#4418
passed with stage
in 21 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dashboard/settings.py
View file @
406247ff
...
...
@@ -29,8 +29,8 @@ DEFAULT_FROM_EMAIL = f'{PROJECT_VERBOSE} <{EMAIL_USER}@{EMAIL_FQDN}>'
EMAIL_BACKEND
=
'django.core.mail.backends.%s'
%
(
'filebased.EmailBackend'
if
DEBUG
else
'smtp.EmailBackend'
)
EMAIL_SUBJECT_PREFIX
=
f
'[
{
PROJECT_VERBOSE
}
] '
ADMINS
=
((
os
.
environ
.
get
(
'ADMIN_NAME'
,
f
'
{
PROJECT_VERBOSE
}
webmaster'
),
os
.
environ
.
get
(
'ADMIN_MAIL'
,
f
'webmaster@
{
DOMAIN_NAME
}
'
)),
)
ADMINS
=
((
os
.
environ
.
get
(
'ADMIN_NAME'
,
f
'
{
PROJECT_VERBOSE
}
webmaster'
),
os
.
environ
.
get
(
'ADMIN_MAIL'
,
f
'webmaster@
{
DOMAIN_NAME
}
'
)),
)
INSTALLED_APPS
=
[
'django.contrib.admin'
,
...
...
dashboard/urls.py
View file @
406247ff
...
...
@@ -7,5 +7,4 @@ urlpatterns = [
url
(
r
'^admin/'
,
admin
.
site
.
urls
),
url
(
r
'^accounts/'
,
include
(
'django.contrib.auth.urls'
)),
url
(
r
''
,
include
(
'rainboard.urls'
)),
]
+
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
]
+
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
rainboard/management/commands/populate.py
View file @
406247ff
...
...
@@ -16,11 +16,11 @@ class Command(BaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
logger
.
info
(
f
'updating licenses'
)
for
data
in
requests
.
get
(
LICENSES
).
json
()[
'licenses'
]:
License
.
objects
.
get_or_create
(
spdx_id
=
data
[
'licenseId'
],
defaults
=
{
'name'
:
data
[
'name'
],
'url'
:
data
[
'detailsUrl'
]
})
License
.
objects
.
get_or_create
(
spdx_id
=
data
[
'licenseId'
],
defaults
=
{
'name'
:
data
[
'name'
],
'url'
:
data
[
'detailsUrl'
]
})
logger
.
info
(
f
'updating forges'
)
for
forge
in
Forge
.
objects
.
order_by
(
'source'
):
...
...
rainboard/management/commands/robotpkg.py
View file @
406247ff
...
...
@@ -20,10 +20,11 @@ class Command(BaseCommand):
for
project
in
Project
.
objects
.
all
():
for
slug
in
[
project
.
slug
,
project
.
slug
.
replace
(
'_'
,
'-'
)]:
for
pkg
in
itertools
.
chain
(
path
.
glob
(
f
'*/
{
slug
}{
project
.
suffix
}
'
),
path
.
glob
(
f
'*/py-
{
slug
}{
project
.
suffix
}
'
)):
obj
,
created
=
Robotpkg
.
objects
.
get_or_create
(
name
=
pkg
.
name
,
category
=
pkg
.
parent
.
name
,
project
=
project
)
for
pkg
in
itertools
.
chain
(
path
.
glob
(
f
'*/
{
slug
}{
project
.
suffix
}
'
),
path
.
glob
(
f
'*/py-
{
slug
}{
project
.
suffix
}
'
)):
obj
,
created
=
Robotpkg
.
objects
.
get_or_create
(
name
=
pkg
.
name
,
category
=
pkg
.
parent
.
name
,
project
=
project
)
if
created
:
logger
.
info
(
f
'
{
project
}
found in
{
pkg
}
'
)
obj
.
update
(
pull
=
False
)
rainboard/management/commands/update.py
View file @
406247ff
...
...
@@ -43,10 +43,9 @@ class Command(BaseCommand):
robotpkg
.
update
(
pull
=
False
)
log
(
f
'
\n
Updating keep doc
\n
'
)
Branch
.
objects
.
filter
(
Q
(
name__endswith
=
'master'
)
|
Q
(
name__endswith
=
'devel'
),
repo__namespace
=
F
(
'project__main_namespace'
),
repo__forge__source
=
SOURCES
.
gitlab
).
update
(
keep_doc
=
True
)
Branch
.
objects
.
filter
(
Q
(
name__endswith
=
'master'
)
|
Q
(
name__endswith
=
'devel'
),
repo__namespace
=
F
(
'project__main_namespace'
),
repo__forge__source
=
SOURCES
.
gitlab
).
update
(
keep_doc
=
True
)
log
(
f
'
\n
Delet perso
\n
'
)
call_command
(
'delete_perso'
)
rainboard/views.py
View file @
406247ff
...
...
@@ -123,9 +123,10 @@ def graph_svg(request):
print
(
'digraph { rankdir=LR;'
,
file
=
f
)
for
project
in
models
.
Project
.
objects
.
filter
(
from_gepetto
=
True
,
archived
=
False
):
print
(
f
'{{I
{
project
.
pk
}
[label="
{
project
}
" URL="
{
project
.
get_absolute_url
()
}
"];}}'
,
file
=
f
)
for
dep
in
models
.
Dependency
.
objects
.
filter
(
project__from_gepetto
=
True
,
library__from_gepetto
=
True
,
project__archived
=
False
,
library__archived
=
False
):
for
dep
in
models
.
Dependency
.
objects
.
filter
(
project__from_gepetto
=
True
,
library__from_gepetto
=
True
,
project__archived
=
False
,
library__archived
=
False
):
print
(
f
'I
{
dep
.
library
.
pk
}
-> I
{
dep
.
project
.
pk
}
;'
,
file
=
f
)
print
(
'}'
,
file
=
f
)
svg
=
run
([
'dot'
,
'/tmp/graph'
,
'-Tsvg'
],
stdout
=
PIPE
).
stdout
.
decode
()
...
...
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