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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Jan 29 19:27:03 CET 2011


Revision: 13108
          http://gar.svn.sourceforge.net/gar/?rev=13108&view=rev
Author:   wahwah
Date:     2011-01-29 18:27:02 +0000 (Sat, 29 Jan 2011)

Log Message:
-----------
pkgdb_web: Listing packages with given catalogname

E.g. http://buildfarm.opencsw.org/pkgdb/catalognames/libnet/

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

Added Paths:
-----------
    csw/mgar/gar/v2/lib/web/templates/Catalogname.html

Modified: csw/mgar/gar/v2/lib/web/pkgdb_web.py
===================================================================
--- csw/mgar/gar/v2/lib/web/pkgdb_web.py	2011-01-29 15:48:41 UTC (rev 13107)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2011-01-29 18:27:02 UTC (rev 13108)
@@ -22,6 +22,7 @@
   r'/maintainers/(\d+)/', 'MaintainerDetail',
   r'/maintainers/(\d+)/checkpkg/', 'MaintainerCheckpkgReport',
   r'/error-tags/', 'ErrorTagList',
+  r'/catalognames/([^/]+)/', 'Catalogname',
   r'/rest/catalogs/([^/]+)/([^/]+)/([^/]+)/pkgname-by-filename',
       'PkgnameByFilename',
   r'/rest/srv4/([0-9a-f]{32})/', 'RestSrv4Detail',
@@ -77,6 +78,18 @@
       raise web.notfound()
 
 
+class Catalogname(object):
+  def GET(self, catalogname):
+    ConnectToDatabase()
+    try:
+      pkgs = models.Srv4FileStats.selectBy(
+          catalogname=catalogname,
+          registered=True).orderBy('mtime')
+      return render.Catalogname(catalogname, pkgs)
+    except sqlobject.main.SQLObjectNotFound, e:
+      raise web.notfound()
+
+
 class Srv4DetailFiles(object):
   def GET(self, md5_sum):
     ConnectToDatabase()

Added: csw/mgar/gar/v2/lib/web/templates/Catalogname.html
===================================================================
--- csw/mgar/gar/v2/lib/web/templates/Catalogname.html	                        (rev 0)
+++ csw/mgar/gar/v2/lib/web/templates/Catalogname.html	2011-01-29 18:27:02 UTC (rev 13108)
@@ -0,0 +1,22 @@
+$def with (catalogname, pkgs)
+<html>
+  <head>
+    <title>
+      $catalogname
+    </title>
+  </head>
+  <body>
+
+    <h2>$catalogname</h2>
+
+    <p>Packages with catalogname '$catalogname'.</p>
+
+<ul>
+$for pkg in pkgs:
+  <li>
+  <a href="../../srv4/$pkg.md5_sum/">$pkg</a>
+  </li>
+</ul>
+
+</body>
+</html>

Modified: csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html
===================================================================
--- csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html	2011-01-29 15:48:41 UTC (rev 13107)
+++ csw/mgar/gar/v2/lib/web/templates/Srv4Detail.html	2011-01-29 18:27:02 UTC (rev 13108)
@@ -13,7 +13,7 @@
       <li><tt>$pkg.md5_sum</tt></li>
       <li>$pkg.basename</li>
       <li>$pkg.pkginst.pkgname</li>
-      <li>$pkg.catalogname</li>
+      <li><a href="../../catalognames/$pkg.catalogname/">$pkg.catalogname</a></li>
       <li>$pkg.version_string</li>
       <li>Filename $pkg.filename_arch</li>
       <li>Pkginfo $pkg.arch</li>


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