Commit 406247ff authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

yapf

parent 596d37dc
Pipeline #4418 passed with stage
in 21 seconds
......@@ -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',
......
......@@ -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)
......@@ -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'):
......
......@@ -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)
......@@ -43,10 +43,9 @@ class Command(BaseCommand):
robotpkg.update(pull=False)
log(f'\nUpdating 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'\nDelet perso\n')
call_command('delete_perso')
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment