diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-15 10:49:57 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-15 10:49:57 -0500 |
commit | bd86ba0d5f5b07ba114134b3c12f8f4843e52ec4 (patch) | |
tree | 27385dcfd8fa3ca609d44c9108a2b714a2ec56fa | |
parent | 291c9eb72e9ca87748e263e9bb8101effaf78240 (diff) | |
parent | 314608aee372c890031cd89f556327a93a2538e6 (diff) |
Merge commit '314608a' (update)parabolaweb-2012-11-15-1
-rw-r--r-- | devel/views.py | 5 | ||||
-rw-r--r-- | main/migrations/0033_mark_any_agnostic.py | 4 | ||||
-rw-r--r-- | main/templatetags/pgp.py | 17 | ||||
-rw-r--r-- | templates/packages/details.html | 17 |
4 files changed, 27 insertions, 16 deletions
diff --git a/devel/views.py b/devel/views.py index 793d1520..33314931 100644 --- a/devel/views.py +++ b/devel/views.py @@ -212,7 +212,10 @@ def report(request, report_name, username=None): bad_files = PackageFile.objects.filter(is_directory=False, directory__contains='/man/', filename__regex=r'\.[0-9n]').exclude( - filename__endswith='.gz').exclude(filename__endswith='.html') + filename__endswith='.gz').exclude( + filename__endswith='.xz').exclude( + filename__endswith='.bz2').exclude( + filename__endswith='.html') if username: pkg_ids = set(packages.values_list('id', flat=True)) bad_files = bad_files.filter(pkg__in=pkg_ids) diff --git a/main/migrations/0033_mark_any_agnostic.py b/main/migrations/0033_mark_any_agnostic.py index 6ba59b43..4f429a2b 100644 --- a/main/migrations/0033_mark_any_agnostic.py +++ b/main/migrations/0033_mark_any_agnostic.py @@ -7,10 +7,10 @@ from django.db import models class Migration(DataMigration): def forwards(self, orm): - orm.Arch.objects.filter(name='any').update(agnostic=True) + orm.Arch.objects.filter(name='any').update(agnostic=True) def backwards(self, orm): - pass + pass models = { 'auth.group': { diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py index d69e2918..1ffc5241 100644 --- a/main/templatetags/pgp.py +++ b/main/templatetags/pgp.py @@ -16,17 +16,28 @@ def format_key(key_id): return u'0x%s' % key_id @register.simple_tag -def pgp_key_link(key_id): +def pgp_key_link(key_id, link_text=None): if not key_id: return "Unknown" + if isinstance(key_id, (int, long)): + key_id = '%X' % key_id + # zero-fill to nearest 8, 16, or 40 chars if necessary + if len(key_id) <= 8: + key_id = key_id.zfill(8) + elif len(key_id) <= 16: + key_id = key_id.zfill(16) + elif len(key_id) <= 40: + key_id = key_id.zfill(40) # Something like 'pgp.mit.edu:11371' pgp_server = getattr(settings, 'PGP_SERVER', None) if not pgp_server: return format_key(key_id) url = 'http://%s/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x%s' % \ (pgp_server, key_id) - values = (url, format_key(key_id), key_id[-8:]) - return '<a href="%s" title="PGP key search for %s">0x%s</a>' % values + if link_text is None: + link_text = '0x%s' % key_id[-8:] + values = (url, format_key(key_id), link_text) + return '<a href="%s" title="PGP key search for %s">%s</a>' % values @register.filter def pgp_fingerprint(key_id, autoescape=True): diff --git a/templates/packages/details.html b/templates/packages/details.html index 1dd39937..2fc5465e 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -103,26 +103,23 @@ </tr><tr> <th>License(s):</th> <td>{{ pkg.licenses.all|join:", " }}</td> - </tr><tr> + </tr> + {% with pkg.groups.all as groups %}{% if groups %} + <tr> <th>Groups:</th> - {% with pkg.groups.all as groups %} - <td>{% if groups %} - {% for g in groups %} + <td>{% for g in groups %} <a href="/groups/{{ pkg.arch.name }}/{{ g.name }}/" title="Group details for {{ g.name }}">{{ g.name }}</a><br/> {% endfor %} - {% else %}None{% endif %} </td> - {% endwith %} </tr> - {% with pkg.provides.all as provides %} - {% if provides %} + {% endif %}{% endwith %} + {% with pkg.provides.all as provides %}{% if provides %} <tr> <th>Provides:</th> <td>{% for p in provides %}{{ p.name }}{% if p.version %}={{ p.version }}{% endif %}<br/>{% endfor %}</td> </tr> - {% endif %} - {% endwith %} + {% endif %}{% endwith %} <tr> <th>Maintainers:</th> {% with pkg.maintainers as maints %} |