aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-06-28 22:03:42 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-06-28 22:03:42 +0000
commit2f89d8bb933358bd4b9c54135c67727ed3a0da28 (patch)
tree4078d9bf8b8db7acb5b61a8933ee03ac53110162 /web
parentChange default expiry time to every 30 minutes, on the 30. (diff)
downloadpackages-2f89d8bb933358bd4b9c54135c67727ed3a0da28.tar.gz
packages-2f89d8bb933358bd4b9c54135c67727ed3a0da28.tar.bz2
packages-2f89d8bb933358bd4b9c54135c67727ed3a0da28.zip
Lots of new arches.
Diffstat (limited to 'web')
-rw-r--r--web/lib/filters.py12
-rw-r--r--web/lib/query_filter.py5
-rw-r--r--web/model.py4
-rw-r--r--web/templates/layout.html4
4 files changed, 14 insertions, 11 deletions
diff --git a/web/lib/filters.py b/web/lib/filters.py
index 6afacc1..8f28147 100644
--- a/web/lib/filters.py
+++ b/web/lib/filters.py
@@ -29,14 +29,12 @@ def limit_leftcount(kwds):
return leftcount
def limit_arches(kwds):
- arches = ConstData.common_arches
+ # Default to common
+ arches = ConstData.arches['common']
if 'arches' in kwds:
- if kwds['arches'] == 'all':
- arches = ConstData.all_arches
- elif kwds['arches'] == 'common':
- arches = ConstData.common_arches
- elif kwds['arches'] == 'exotic':
- arches = ConstData.exotic_arches
+ print "Testing %s against %s" % (kwds['arches'], '/'.join(ConstData.arches.keys()))
+ if kwds['arches'] in ConstData.arches.keys():
+ arches = ConstData.arches[kwds['arches']]
return arches
class EntryFilters(object):
diff --git a/web/lib/query_filter.py b/web/lib/query_filter.py
index afa6fad..4b44fc2 100644
--- a/web/lib/query_filter.py
+++ b/web/lib/query_filter.py
@@ -1,4 +1,5 @@
import cherrypy
+from etc.const_data import ConstData
# We use short variable names!
# pylint: disable-msg=C0103
@@ -27,7 +28,7 @@ def sanitize_query_string(qsargs=None):
key = 'arches'
if key in qsargs:
val = qsargs[key]
- if val in ['all', 'exotic', 'common']:
+ if val in ConstData.arches.keys():
newqs[key] = val
return newqs
@@ -55,7 +56,7 @@ def check_page_variables(kwds=None):
if 'safeqs_arches' not in kwds:
qsd = {}
- for i in ['all', 'exotic', 'common']:
+ for i in ConstData.arches.keys():
qsd[i] = kwds['safeqs'].copy()
qsd[i]['arches'] = i
# arches=common is the default
diff --git a/web/model.py b/web/model.py
index 22672f0..998ca52 100644
--- a/web/model.py
+++ b/web/model.py
@@ -81,7 +81,7 @@ class PackageDB(object):
"""Wrapper for all SQL functionality to read from the database"""
# This should match /usr/portage/profiles/arch.list
- arches = frozenset(ConstData.all_arches)
+ arches = frozenset(ConstData.arches['all'])
# DB fun
dbconfig = {}
db = None
@@ -620,7 +620,7 @@ class PackageDB(object):
if last_cpv is not None:
ret_list.append(pkg)
pkg = {'atom': current_cpv}
- for i in frozenset(ConstData.all_arches):
+ for i in frozenset(ConstData.arches['all']):
pkg[i] = {'mode':'', 'name': 'blank'}
last_cpv = current_cpv
diff --git a/web/templates/layout.html b/web/templates/layout.html
index ea994b1..904792f 100644
--- a/web/templates/layout.html
+++ b/web/templates/layout.html
@@ -103,9 +103,13 @@ def alpha_url(baseurl):
<div py:with="baseurl = cherrypy.request.path_info">
<span class="left-legend">Arches</span>
+ <br />
<a href="${relurl(baseurl,qs=safeqs_arches['common'])}">C</a>
<a href="${relurl(baseurl,qs=safeqs_arches['exotic'])}">E</a>
<a href="${relurl(baseurl,qs=safeqs_arches['all'])}">A</a>
+ <a href="${relurl(baseurl,qs=safeqs_arches['fbsd'])}">F</a>
+ <a href="${relurl(baseurl,qs=safeqs_arches['prefix'])}">P</a>
+ <a href="${relurl(baseurl,qs=safeqs_arches['linux'])}">L</a>
<ul class="platforms left-bar-list">
<li><a href="${relurl('/')}">all</a></li>
<li py:for="arch in sorted(arches)">