[csw-devel] SF.net SVN: gar:[14587] csw/mgar/gar/v2/lib/web

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue May 17 10:22:46 CEST 2011


Revision: 14587
          http://gar.svn.sourceforge.net/gar/?rev=14587&view=rev
Author:   wahwah
Date:     2011-05-17 08:22:46 +0000 (Tue, 17 May 2011)

Log Message:
-----------
pkgdb-web: Displaying package metadata

Displaying the raw Python data structure, using pretty print (import
pprint).  It's a step towards easy package reviews on the web site.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/web/pkgdb_web.py
    csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html

Modified: csw/mgar/gar/v2/lib/web/pkgdb_web.py
===================================================================
--- csw/mgar/gar/v2/lib/web/pkgdb_web.py	2011-05-16 22:28:48 UTC (rev 14586)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2011-05-17 08:22:46 UTC (rev 14587)
@@ -5,6 +5,7 @@
 import web
 import sqlobject
 import json
+import pprint
 from lib.python import models
 from lib.python import configuration
 from lib.python import pkgdb
@@ -75,6 +76,7 @@
       osrels = models.OsRelease.select()
       catrels = models.CatalogRelease.select()
       all_tags = list(models.CheckpkgErrorTag.selectBy(srv4_file=pkg))
+      pkgstats_raw = pprint.pformat(pkg.GetStatsStruct())
       if pkg.arch.name == 'all':
         archs = models.Architecture.select(models.Architecture.q.name!='all')
       else:
@@ -88,7 +90,7 @@
             tags_by_cat[key] = tags
             tags_and_catalogs.append((osrel, arch, catrel, tags))
       return render.Srv4Detail(pkg, overrides, tags_by_cat, all_tags,
-          tags_and_catalogs)
+          tags_and_catalogs, pkgstats_raw)
     except sqlobject.main.SQLObjectNotFound, e:
       raise web.notfound()
 

Modified: csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html
===================================================================
--- csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html	2011-05-16 22:28:48 UTC (rev 14586)
+++ csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html	2011-05-17 08:22:46 UTC (rev 14587)
@@ -1,4 +1,4 @@
-$def with (pkg, overrides, tags_by_cat, tags, tags_and_catalogs)
+$def with (pkg, overrides, tags_by_cat, tags, tags_and_catalogs, pkgstats_raw)
 <html>
   <head>
     <title>
@@ -84,5 +84,10 @@
     </li>
 </ul>
 
+<h3>Raw dump of the Python data structure</h3>
+<pre>
+$pkgstats_raw
+</pre>
+
 </body>
 </html>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list