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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Mar 29 21:44:17 CET 2013


Revision: 20538
          http://gar.svn.sourceforge.net/gar/?rev=20538&view=rev
Author:   wahwah
Date:     2013-03-29 20:44:17 +0000 (Fri, 29 Mar 2013)
Log Message:
-----------
pkgdb-web: Do not show pkginfo

Sometimes data_obj is missing from a row and 500 error is served. Also,
displaying pkgmap requires deserializing of the whole data structure, which is
currently very slow. Therefore, we won't be showing pkgmap by default.

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	2013-03-29 20:44:04 UTC (rev 20537)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2013-03-29 20:44:17 UTC (rev 20538)
@@ -123,6 +123,8 @@
       archs = models.Architecture.select(models.Architecture.q.name!='all')
     else:
       archs = [pkg.arch]
+    # pkgmap is disabled for now.
+    pkgmap = []
     for catrel in catrels:
       for arch in archs:
         for osrel in osrels:
@@ -132,7 +134,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, pkgstats_raw)
+        tags_and_catalogs, pkgstats_raw, pkgmap)
 
 
 class Catalogname(object):

Modified: csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html
===================================================================
--- csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html	2013-03-29 20:44:04 UTC (rev 20537)
+++ csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html	2013-03-29 20:44:17 UTC (rev 20538)
@@ -1,4 +1,4 @@
-$def with (pkg, overrides, tags_by_cat, tags, tags_and_catalogs, pkgstats_raw)
+$def with (pkg, overrides, tags_by_cat, tags, tags_and_catalogs, pkgstats_raw, pkgmap)
 <html>
   <head>
     <title>
@@ -84,13 +84,14 @@
     </li>
 </ul>
 
-<h3>pkgmap</h3>
+$if pkgmap:
+  <h3>pkgmap</h3>
 
-<div style="background-color: #DDD; font-family: monospace;">
-<pre>
-$for entry in pkg.GetStatsStruct()["pkgmap"]: $entry["line"]
-</pre>
-</div>
+  <div style="background-color: #DDD; font-family: monospace;">
+  <pre>
+  $for line in pkgmap: $line
+  </pre>
+  </div>
 
 <h3>Raw dump of the Python data structure</h3>
 <pre>

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