From e578491c4ba6f16b6b4666fe74a0722c22987841 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Tue, 25 Aug 2009 11:39:48 -0400 Subject: [PATCH] More polish and DDE updates. --- neurodebian/dde.py | 83 ++++++++++++++++++++++++---------- neurodebian/templates/pkg.rst | 23 +++++++--- sphinx/_static/neurodebian.css | 12 +++-- sphinx/index.rst | 4 ++ 4 files changed, 88 insertions(+), 34 deletions(-) diff --git a/neurodebian/dde.py b/neurodebian/dde.py index 6593e44..bc03b8c 100644 --- a/neurodebian/dde.py +++ b/neurodebian/dde.py @@ -364,34 +364,67 @@ def import_dde(cfg, db): q = dde_get(query_url + "/packages/all/%s" % p) if q: db[p]['main'] = q - for d in dists: - dist, release = d.split('-') - q = dde_get(query_url + "/dist/d:%s/r:%s/p:%s" % (dist, release, p)) - if not q: - continue + # get latest popcon info for debian and ubuntu + # cannot use origin field itself, since it is none for few packages + # i.e. python-nifti + origin = q['drc'].split()[0] + print 'popcon query for', p + if origin == 'ubuntu': + print 'have ubuntu first' + if q.has_key('popcon'): + print 'ubuntu has popcon' + db[p]['main']['ubuntu_popcon'] = q['popcon'] + # if we have ubuntu, need to get debian + q = dde_get(query_url + "/packages/prio-debian-sid/%s" % p) + if q and q.has_key('popcon'): + print 'debian has popcon' + db[p]['main']['debian_popcon'] = q['popcon'] + elif origin == 'debian': + print 'have debian first' + if q.has_key('popcon'): + print 'debian has popcon' + db[p]['main']['debian_popcon'] = q['popcon'] + # if we have debian, need to get ubuntu + q = dde_get(query_url + "/packages/prio-ubuntu-karmic/%s" % p) + if q and q.has_key('popcon'): + print 'ubuntu has popcon' + db[p]['main']['ubuntu_popcon'] = q['popcon'] + else: + print("Ignoring unkown origin '%s' for package '%s'." \ + % (origin, p)) + + # now get info for package from all releases in UDD + q = dde_get(query_url + "/dist/p:%s" % p) + if not q: + continue + # hold all info about this package per distribution release + info = {} + for cp in q: + distkey = (trans_codename(cp['release'], cfg), + "%s-%s" % (cp['distribution'], cp['release'])) + if not info.has_key(distkey): + info[distkey] = cp + # turn into a list to append others later + info[distkey]['architecture'] = [info[distkey]['architecture']] # accumulate data for multiple over archs - item = None - for i in q: - if item is None: - item = i + else: + comp = apt.VersionCompare(cp['version'], + info[distkey]['version']) + # found another arch for the same version + if comp == 0: + info[distkey]['architecture'].append(cp['architecture']) + # found newer version, dump the old ones + elif comp > 0: + info[distkey] = cp # turn into a list to append others later - item['architecture'] = [item['architecture']] + info[distkey]['architecture'] = [info[distkey]['architecture']] + # simply ignore older versions else: - comp = apt.VersionCompare(i['version'], item['version']) - # found another arch for the same version - if comp == 0: - item['architecture'].append(i['architecture']) - # found newer version, dump the old ones - elif comp > 0: - item = i - # turn into a list to append others later - item['architecture'] = [item['architecture']] - # simply ignore older versions - else: - pass - - # finally assign the new package data - db[p][(trans_codename(d.split('-')[1], cfg),d)] = item + pass + + # finally assign the new package data + for k, v in info.iteritems(): + db[p][k] = v return db diff --git a/neurodebian/templates/pkg.rst b/neurodebian/templates/pkg.rst index 7f12e1c..e5009f0 100644 --- a/neurodebian/templates/pkg.rst +++ b/neurodebian/templates/pkg.rst @@ -15,6 +15,23 @@ Associated `Debian Pure Blends `_: {% endfor %} {% endif %} +{% if db.main.debian_popcon or db.main.ubuntu_popcon %} +Number of reported installations [#]_: +{% if db.main.debian_popcon %} +- Debian: {{ db.main.debian_popcon.insts }} (`more info `_) +{% endif %} +{% if db.main.ubuntu_popcon %} +- Ubuntu: {{ db.main.ubuntu_popcon.insts }} +{% endif %} + +.. [#] Due to the nature of this data, the reported number can only be + considered a conservative estimate of the lower bound of the true + number of installations. + +{% endif %} + + + Binary packages =============== @@ -61,9 +78,6 @@ Debian - Maintainer: {{ distpkg.maintainer }} - Bug reports: `Debian bugtracking system `_ -{% if distpkg.popcon %} - - Reported installations: {{ distpkg.popcon.insts }} (`more info `_) -{% endif %} {% endif %} {% else %} *There are no official Debian packages available.* @@ -91,9 +105,6 @@ Ubuntu - Maintainer: {{ distpkg.maintainer }} - Bug reports: `Ubuntu Launchpad `_ -{% if distpkg.popcon %} - - Reported installations: {{ distpkg.popcon.insts }} -{% endif %} {% endif %} {% else %} *There are no official Ubuntu packages available.* diff --git a/sphinx/_static/neurodebian.css b/sphinx/_static/neurodebian.css index a7bf88a..ed90176 100644 --- a/sphinx/_static/neurodebian.css +++ b/sphinx/_static/neurodebian.css @@ -445,8 +445,8 @@ div.warning { } div.note { - background-color: #eee; - border: 1px solid #ccc; + background-color: #eaf2f9; + border: 1px solid #3d7aa5; border-left: none; border-right: none; } @@ -484,6 +484,7 @@ table.field-list td, table.field-list th { table.footnote td, table.footnote th { border: 0 !important; + font-size: 0.7em; } .field-list ul { @@ -579,7 +580,12 @@ tt.xref, a tt { font-weight: bold; } -.footnote:target { background-color: #ffa } +.footnote:target { background-color: #ffa } + +.footnote-reference { + font-size: 0.7em; + vertical-align: top; +} h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { background-color: transparent; diff --git a/sphinx/index.rst b/sphinx/index.rst index 7e21af1..d9ef80b 100644 --- a/sphinx/index.rst +++ b/sphinx/index.rst @@ -37,6 +37,10 @@ releases and repository mirrors: .. include:: sources_lists .. note:: + Thanks to the Department of Experimental Psychology at the University of + Mageburg, and the Department of Psychological and Brain Sciences at Dartmouth + College for hosting a mirror. + If your are interested in mirroring the repository, please see the :ref:`faq`. Once this is done, you have to update the package index. Use your favorite -- 2.39.2