diff --git a/euscanwww/djeuscan/management/commands/scan_metadata.py b/euscanwww/djeuscan/management/commands/scan_metadata.py index d9c7e49..c3f4c4b 100644 --- a/euscanwww/djeuscan/management/commands/scan_metadata.py +++ b/euscanwww/djeuscan/management/commands/scan_metadata.py @@ -13,7 +13,7 @@ from djeuscan.models import Package, Herd, Maintainer class ScanMetadata(object): - def __init__(self, quiet): + def __init__(self, quiet=False): self.quiet = quiet self.style = color_style() diff --git a/euscanwww/djeuscan/management/commands/scan_portage.py b/euscanwww/djeuscan/management/commands/scan_portage.py index 9533730..4471fac 100644 --- a/euscanwww/djeuscan/management/commands/scan_portage.py +++ b/euscanwww/djeuscan/management/commands/scan_portage.py @@ -241,7 +241,7 @@ class ScanPortage(object): @commit_on_success -def purge_versions(options): +def purge_versions(quiet=False, nolog=False): # For each dead versions for version in Version.objects.filter(packaged=True, alive=False): if version.overlay == 'gentoo': @@ -251,10 +251,10 @@ def purge_versions(options): version.package.n_versions -= 1 version.package.save() - if not options['quiet']: + if not quiet: sys.stdout.write('- [v] %s\n' % (version)) - if options['no-log']: + if nolog: continue VersionLog.objects.create( @@ -335,7 +335,7 @@ class Command(BaseCommand): scan_portage.scan(package[:-1]) if options['purge-versions']: - purge_versions(options) + purge_versions(options["quiet"], options["no-log"]) if not options['quiet']: self.stdout.write('Done.\n') diff --git a/euscanwww/djeuscan/models.py b/euscanwww/djeuscan/models.py index 727deef..fee8dc4 100644 --- a/euscanwww/djeuscan/models.py +++ b/euscanwww/djeuscan/models.py @@ -190,6 +190,11 @@ class EuscanResult(models.Model): self.full_clean() super(EuscanResult, self).save(*args, **kwargs) + def __unicode__(self): + return '[%s] %s/%s' % ( + self.datetime, self.package.category, self.package.name + ) + class Log(models.Model): """ diff --git a/euscanwww/djeuscan/tasks.py b/euscanwww/djeuscan/tasks.py index e614a70..89a90dc 100644 --- a/euscanwww/djeuscan/tasks.py +++ b/euscanwww/djeuscan/tasks.py @@ -28,7 +28,7 @@ def scan_metadata_task(query, obj=None): logger.info("Starting metadata scanning for package %s ...", query) scan_metadata = ScanMetadata() - scan_metadata.scan(query) + scan_metadata.scan(query, obj) @task @@ -95,3 +95,17 @@ def scan_upstream_task(query): @task def scan_upstream_purge_task(): scan_upstream_purge() + + +launchable_tasks = [ + regen_rrds_task, + update_counters_task, + scan_metadata_task, + scan_metadata_all_task, + scan_portage_all_task, + scan_portage_task, + scan_portage_purge_task, + scan_upstream_all_task, + scan_upstream_task, + scan_upstream_purge_task, +] diff --git a/euscanwww/djeuscan/templates/admin/djcelery/taskstate/change_list.html b/euscanwww/djeuscan/templates/admin/djcelery/taskstate/change_list.html new file mode 100644 index 0000000..693214a --- /dev/null +++ b/euscanwww/djeuscan/templates/admin/djcelery/taskstate/change_list.html @@ -0,0 +1,77 @@ +{% extends "admin/change_list.html" %} + +{% load url from future %} + +{% block object-tools %} +