From 917a290e3a4a46bca68a2ebf586abbecde236937 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Thu, 5 May 2011 18:10:47 +0200 Subject: [PATCH] euscanwww: finish charts Signed-off-by: Corentin Chary --- .gitignore | 4 +- euscanwww/euscan/charts.py | 2 + .../euscan/management/commands/regen-rrds.py | 5 +- .../management/commands/scan-portage.py | 2 +- .../management/commands/update-counters.py | 31 ++-- ...del_herdlog__del_maintainerlog__add_log.py | 139 ++++++++++++++++++ ...gorylog__add_herdlog__add_maintainerlog.py | 130 ++++++++++++++++ euscanwww/euscan/models.py | 47 ++---- euscanwww/scripts/euscan-update.sh | 5 +- euscanwww/templates/euscan/category.html | 2 + 10 files changed, 315 insertions(+), 52 deletions(-) create mode 100644 euscanwww/euscan/migrations/0005_auto__del_categorylog__del_herdlog__del_maintainerlog__add_log.py create mode 100644 euscanwww/euscan/migrations/0006_auto__add_worldlog__add_categorylog__add_herdlog__add_maintainerlog.py diff --git a/.gitignore b/.gitignore index e645833..ee88a09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *~ -*.pyc \ No newline at end of file +*.pyc +euscanwww/rrd/*.rrd +euscanwww/media/charts/*.png \ No newline at end of file diff --git a/euscanwww/euscan/charts.py b/euscanwww/euscan/charts.py index 0eb6ea9..ff01401 100644 --- a/euscanwww/euscan/charts.py +++ b/euscanwww/euscan/charts.py @@ -52,6 +52,8 @@ def rrd_name(**kwargs): return name def chart_name(name, **kwargs): + name = name.replace('_', '-') + if 'category' in kwargs and kwargs['category']: name += '-%s' % kwargs['category'] if 'herd' in kwargs and kwargs['herd']: diff --git a/euscanwww/euscan/management/commands/regen-rrds.py b/euscanwww/euscan/management/commands/regen-rrds.py index ffc1f0f..f3ed5c8 100644 --- a/euscanwww/euscan/management/commands/regen-rrds.py +++ b/euscanwww/euscan/management/commands/regen-rrds.py @@ -3,7 +3,7 @@ import datetime from optparse import make_option from django.core.management.base import BaseCommand, CommandError -from euscanwww.euscan.models import Package, HerdLog, MaintainerLog, CategoryLog, Herd, Maintainer, Version +from euscanwww.euscan.models import HerdLog, MaintainerLog, CategoryLog, WorldLog from euscanwww.euscan import charts class Command(BaseCommand): @@ -11,6 +11,9 @@ class Command(BaseCommand): help = 'Regenerate rrd database' def handle(self, *args, **options): + for wlog in WorldLog.objects.all(): + charts.rrd_update('world', wlog.datetime, wlog) + for clog in CategoryLog.objects.all(): charts.rrd_update('category-%s' % clog.category, clog.datetime, clog) diff --git a/euscanwww/euscan/management/commands/scan-portage.py b/euscanwww/euscan/management/commands/scan-portage.py index e818d09..c56a056 100644 --- a/euscanwww/euscan/management/commands/scan-portage.py +++ b/euscanwww/euscan/management/commands/scan-portage.py @@ -122,7 +122,7 @@ class Command(BaseCommand): cat, pkg, ver, rev = portage.catpkgsplit(cpv) packages['%s/%s' % (cat, pkg)] = True - continue + if not package or not (cat == package.category and pkg == package.name): package = self.store_package(options, cat, pkg) diff --git a/euscanwww/euscan/management/commands/update-counters.py b/euscanwww/euscan/management/commands/update-counters.py index dc564b9..1fbd9b1 100644 --- a/euscanwww/euscan/management/commands/update-counters.py +++ b/euscanwww/euscan/management/commands/update-counters.py @@ -5,17 +5,10 @@ from optparse import make_option from django.db.models import Count, Sum from django.db.transaction import commit_on_success from django.core.management.base import BaseCommand, CommandError -from euscanwww.euscan.models import Package, HerdLog, MaintainerLog, CategoryLog, Herd, Maintainer, Version +from euscanwww.euscan.models import Package, Herd, Maintainer, Version +from euscanwww.euscan.models import HerdLog, MaintainerLog, CategoryLog, WorldLog from euscanwww.euscan import charts -class World: - n_packages_gentoo = 0 - n_packages_overlay = 0 - n_packages_outdated = 0 - n_versions_gentoo = 0 - n_versions_overlay = 0 - n_versions_upstream = 0 - class Command(BaseCommand): _overlays = {} help = 'Update counters' @@ -35,11 +28,13 @@ class Command(BaseCommand): categories = {} herds = {} maintainers = {} - world = World() # Could be done using raw SQL queries, but I don't have time for that # right now ... + wlog = WorldLog() + wlog.datetime = now + for cat in Package.objects.values('category').distinct(): clog = CategoryLog() clog.datetime = now @@ -95,13 +90,13 @@ class Command(BaseCommand): categories[package.category].n_versions_overlay += package.n_overlay categories[package.category].n_versions_upstream += package.n_versions - package.n_packaged - package.n_overlay - world.n_packages_gentoo += n_packages_gentoo - world.n_packages_overlay += n_packages_overlay - world.n_packages_outdated += n_packages_outdated + wlog.n_packages_gentoo += n_packages_gentoo + wlog.n_packages_overlay += n_packages_overlay + wlog.n_packages_outdated += n_packages_outdated - world.n_versions_gentoo += package.n_packaged - world.n_versions_overlay += package.n_overlay - world.n_versions_upstream += package.n_versions - package.n_packaged - package.n_overlay + wlog.n_versions_gentoo += package.n_packaged + wlog.n_versions_overlay += package.n_overlay + wlog.n_versions_upstream += package.n_versions - package.n_packaged - package.n_overlay for clog in categories.values(): if not options['quiet']: @@ -121,4 +116,6 @@ class Command(BaseCommand): charts.rrd_update('maintainer-%d' % mlog.maintainer.id, now, mlog) mlog.save() - charts.rrd_update('world', now, world) + wlog.save() + + charts.rrd_update('world', now, wlog) diff --git a/euscanwww/euscan/migrations/0005_auto__del_categorylog__del_herdlog__del_maintainerlog__add_log.py b/euscanwww/euscan/migrations/0005_auto__del_categorylog__del_herdlog__del_maintainerlog__add_log.py new file mode 100644 index 0000000..3c9d744 --- /dev/null +++ b/euscanwww/euscan/migrations/0005_auto__del_categorylog__del_herdlog__del_maintainerlog__add_log.py @@ -0,0 +1,139 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Deleting model 'CategoryLog' + db.delete_table('euscan_categorylog') + + # Deleting model 'HerdLog' + db.delete_table('euscan_herdlog') + + # Deleting model 'MaintainerLog' + db.delete_table('euscan_maintainerlog') + + # Adding model 'Log' + db.create_table('euscan_log', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datetime', self.gf('django.db.models.fields.DateTimeField')()), + ('n_packages_gentoo', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_packages_overlay', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_packages_outdated', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_gentoo', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_overlay', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_upstream', self.gf('django.db.models.fields.IntegerField')(default=0)), + )) + db.send_create_signal('euscan', ['Log']) + + + def backwards(self, orm): + + # Adding model 'CategoryLog' + db.create_table('euscan_categorylog', ( + ('category', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('n_packages_gentoo', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_packages_outdated', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_packages_overlay', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_upstream', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_overlay', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_gentoo', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datetime', self.gf('django.db.models.fields.DateTimeField')()), + )) + db.send_create_signal('euscan', ['CategoryLog']) + + # Adding model 'HerdLog' + db.create_table('euscan_herdlog', ( + ('n_packages_gentoo', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_overlay', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_packages_outdated', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_packages_overlay', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_upstream', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('herd', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['euscan.Herd'])), + ('n_versions_gentoo', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datetime', self.gf('django.db.models.fields.DateTimeField')()), + )) + db.send_create_signal('euscan', ['HerdLog']) + + # Adding model 'MaintainerLog' + db.create_table('euscan_maintainerlog', ( + ('n_packages_gentoo', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_overlay', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_packages_outdated', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('maintainer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['euscan.Maintainer'])), + ('n_packages_overlay', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_upstream', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('n_versions_gentoo', self.gf('django.db.models.fields.IntegerField')(default=0)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('datetime', self.gf('django.db.models.fields.DateTimeField')()), + )) + db.send_create_signal('euscan', ['MaintainerLog']) + + # Deleting model 'Log' + db.delete_table('euscan_log') + + + models = { + 'euscan.euscanresult': { + 'Meta': {'object_name': 'EuscanResult'}, + 'datetime': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['euscan.Package']"}), + 'result': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + 'euscan.herd': { + 'Meta': {'object_name': 'Herd'}, + 'email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'herd': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + }, + 'euscan.log': { + 'Meta': {'object_name': 'Log'}, + 'datetime': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'n_packages_gentoo': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_packages_outdated': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_packages_overlay': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions_gentoo': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions_overlay': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions_upstream': ('django.db.models.fields.IntegerField', [], {'default': '0'}) + }, + 'euscan.maintainer': { + 'Meta': {'object_name': 'Maintainer'}, + 'email': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'euscan.package': { + 'Meta': {'unique_together': "(['category', 'name'],)", 'object_name': 'Package'}, + 'category': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'herds': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['euscan.Herd']", 'symmetrical': 'False', 'blank': 'True'}), + 'homepage': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'maintainers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['euscan.Maintainer']", 'symmetrical': 'False', 'blank': 'True'}), + 'n_overlay': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_packaged': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'euscan.version': { + 'Meta': {'unique_together': "(['package', 'slot', 'revision', 'version', 'overlay'],)", 'object_name': 'Version'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'overlay': ('django.db.models.fields.CharField', [], {'default': "'gentoo'", 'max_length': '128'}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['euscan.Package']"}), + 'packaged': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'revision': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'slot': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'urls': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + } + } + + complete_apps = ['euscan'] diff --git a/euscanwww/euscan/migrations/0006_auto__add_worldlog__add_categorylog__add_herdlog__add_maintainerlog.py b/euscanwww/euscan/migrations/0006_auto__add_worldlog__add_categorylog__add_herdlog__add_maintainerlog.py new file mode 100644 index 0000000..14804f1 --- /dev/null +++ b/euscanwww/euscan/migrations/0006_auto__add_worldlog__add_categorylog__add_herdlog__add_maintainerlog.py @@ -0,0 +1,130 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Adding model 'WorldLog' + db.create_table('euscan_worldlog', ( + ('log_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['euscan.Log'], unique=True, primary_key=True)), + )) + db.send_create_signal('euscan', ['WorldLog']) + + # Adding model 'CategoryLog' + db.create_table('euscan_categorylog', ( + ('log_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['euscan.Log'], unique=True, primary_key=True)), + ('category', self.gf('django.db.models.fields.CharField')(max_length=128)), + )) + db.send_create_signal('euscan', ['CategoryLog']) + + # Adding model 'HerdLog' + db.create_table('euscan_herdlog', ( + ('log_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['euscan.Log'], unique=True, primary_key=True)), + ('herd', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['euscan.Herd'])), + )) + db.send_create_signal('euscan', ['HerdLog']) + + # Adding model 'MaintainerLog' + db.create_table('euscan_maintainerlog', ( + ('log_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['euscan.Log'], unique=True, primary_key=True)), + ('maintainer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['euscan.Maintainer'])), + )) + db.send_create_signal('euscan', ['MaintainerLog']) + + + def backwards(self, orm): + + # Deleting model 'WorldLog' + db.delete_table('euscan_worldlog') + + # Deleting model 'CategoryLog' + db.delete_table('euscan_categorylog') + + # Deleting model 'HerdLog' + db.delete_table('euscan_herdlog') + + # Deleting model 'MaintainerLog' + db.delete_table('euscan_maintainerlog') + + + models = { + 'euscan.categorylog': { + 'Meta': {'object_name': 'CategoryLog', '_ormbases': ['euscan.Log']}, + 'category': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'log_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['euscan.Log']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'euscan.euscanresult': { + 'Meta': {'object_name': 'EuscanResult'}, + 'datetime': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['euscan.Package']"}), + 'result': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + 'euscan.herd': { + 'Meta': {'object_name': 'Herd'}, + 'email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'herd': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + }, + 'euscan.herdlog': { + 'Meta': {'object_name': 'HerdLog', '_ormbases': ['euscan.Log']}, + 'herd': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['euscan.Herd']"}), + 'log_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['euscan.Log']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'euscan.log': { + 'Meta': {'object_name': 'Log'}, + 'datetime': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'n_packages_gentoo': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_packages_outdated': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_packages_overlay': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions_gentoo': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions_overlay': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions_upstream': ('django.db.models.fields.IntegerField', [], {'default': '0'}) + }, + 'euscan.maintainer': { + 'Meta': {'object_name': 'Maintainer'}, + 'email': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'euscan.maintainerlog': { + 'Meta': {'object_name': 'MaintainerLog', '_ormbases': ['euscan.Log']}, + 'log_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['euscan.Log']", 'unique': 'True', 'primary_key': 'True'}), + 'maintainer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['euscan.Maintainer']"}) + }, + 'euscan.package': { + 'Meta': {'unique_together': "(['category', 'name'],)", 'object_name': 'Package'}, + 'category': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'herds': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['euscan.Herd']", 'symmetrical': 'False', 'blank': 'True'}), + 'homepage': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'maintainers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['euscan.Maintainer']", 'symmetrical': 'False', 'blank': 'True'}), + 'n_overlay': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_packaged': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'euscan.version': { + 'Meta': {'unique_together': "(['package', 'slot', 'revision', 'version', 'overlay'],)", 'object_name': 'Version'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'overlay': ('django.db.models.fields.CharField', [], {'default': "'gentoo'", 'max_length': '128'}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['euscan.Package']"}), + 'packaged': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'revision': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'slot': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'urls': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'euscan.worldlog': { + 'Meta': {'object_name': 'WorldLog', '_ormbases': ['euscan.Log']}, + 'log_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['euscan.Log']", 'unique': 'True', 'primary_key': 'True'}) + } + } + + complete_apps = ['euscan'] diff --git a/euscanwww/euscan/models.py b/euscanwww/euscan/models.py index ea72d05..2687daa 100644 --- a/euscanwww/euscan/models.py +++ b/euscanwww/euscan/models.py @@ -58,8 +58,7 @@ class EuscanResult(models.Model): result = models.TextField(blank=True) # Keep data for charts -class CategoryLog(models.Model): - category = models.CharField(max_length=128) +class Log(models.Model): datetime = models.DateTimeField() n_packages_gentoo = models.IntegerField(default=0) # Packages up to date in the main portage tree @@ -71,43 +70,29 @@ class CategoryLog(models.Model): n_versions_upstream = models.IntegerField(default=0) # Upstream versions, not in the main tree or overlays def __unicode__(self): - return u'%s [%d:%d:%d] [%d:%d:%d]' % \ - (self.category, self.n_packages_gentoo, self.n_packages_overlay, self.n_packages_outdated, \ + return u'[%d:%d:%d] [%d:%d:%d]' % \ + (self.n_packages_gentoo, self.n_packages_overlay, self.n_packages_outdated, \ self.n_versions_gentoo, self.n_versions_overlay, self.n_versions_upstream) +class WorldLog(Log): + def __unicode__(self): + return u'world ' + Log.__unicode__(self) -class HerdLog(models.Model): +class CategoryLog(Log): + category = models.CharField(max_length=128) + + def __unicode__(self): + return u'%s %s' % (self.category, Log.__unicode__(self)) + +class HerdLog(Log): herd = models.ForeignKey(Herd) - datetime = models.DateTimeField() - - n_packages_gentoo = models.IntegerField(default=0) - n_packages_overlay = models.IntegerField(default=0) - n_packages_outdated = models.IntegerField(default=0) - - n_versions_gentoo = models.IntegerField(default=0) - n_versions_overlay = models.IntegerField(default=0) - n_versions_upstream = models.IntegerField(default=0) def __unicode__(self): - return u'%s [%d:%d:%d] [%d:%d:%d]' % \ - (self.herd, self.n_packages_gentoo, self.n_packages_overlay, self.n_packages_outdated, \ - self.n_versions_gentoo, self.n_versions_overlay, self.n_versions_upstream) + return u'%s %s' % (self.herd, Log.__unicode__(self)) - -class MaintainerLog(models.Model): +class MaintainerLog(Log): maintainer = models.ForeignKey(Maintainer) - datetime = models.DateTimeField() - - n_packages_gentoo = models.IntegerField(default=0) - n_packages_overlay = models.IntegerField(default=0) - n_packages_outdated = models.IntegerField(default=0) - - n_versions_gentoo = models.IntegerField(default=0) - n_versions_overlay = models.IntegerField(default=0) - n_versions_upstream = models.IntegerField(default=0) def __unicode__(self): - return u'%s [%d:%d:%d] [%d:%d:%d]' % \ - (self.maintainer, self.n_packages_gentoo, self.n_packages_overlay, self.n_packages_outdated, \ - self.n_versions_gentoo, self.n_versions_overlay, self.n_versions_upstream) + return u'%s %s' % (self.maintainer, Log.__unicode__(self)) diff --git a/euscanwww/scripts/euscan-update.sh b/euscanwww/scripts/euscan-update.sh index 1aae607..c2c7e00 100644 --- a/euscanwww/scripts/euscan-update.sh +++ b/euscanwww/scripts/euscan-update.sh @@ -17,7 +17,7 @@ # eix-update ## Scan portage (packages, versions) -# python manage.py scan-portage --all +# python manage.py scan-portage --all --purge ## Scan metadata (herds, maintainers, homepages, ...) # python manage.py scan-metadata --all @@ -25,3 +25,6 @@ ## Scan uptsream packages # python manage.py scan-upstream --all # eix --only-names -x | gparallel --jobs 400% euscan | python manage.py scan-upstream --feed + +## Update counters +# python manage.py update-counters \ No newline at end of file diff --git a/euscanwww/templates/euscan/category.html b/euscanwww/templates/euscan/category.html index 97ceb08..0b29eb1 100644 --- a/euscanwww/templates/euscan/category.html +++ b/euscanwww/templates/euscan/category.html @@ -16,7 +16,9 @@

All Time

+ + {% endblock %}