[Pypi-checkins] r802 - trunk/pypi

richard python-checkins at python.org
Sat Jul 24 15:02:42 CEST 2010


Author: richard
Date: Sat Jul 24 15:02:41 2010
New Revision: 802

Modified:
   trunk/pypi/webui.py
Log:
fix

Modified: trunk/pypi/webui.py
==============================================================================
--- trunk/pypi/webui.py	(original)
+++ trunk/pypi/webui.py	Sat Jul 24 15:02:41 2010
@@ -1060,6 +1060,24 @@
         self.handler.end_headers()
         self.wfile.write(json.dumps(d))
 
+    def _get_pkg_info(self, name, version):
+        # get the appropriate package info from the database
+        if name is None:
+            try:
+                name = self.form['name']
+            except KeyError:
+                raise NotFound, 'no package name supplied'
+        if version is None:
+            if self.form.has_key('version'):
+                version = self.form['version']
+            else:
+                l = self.store.get_latest_release(name, hidden=False)
+                try:
+                    version = l[-1][1]
+                except IndexError:
+                    raise NotFound, 'no releases'
+        return self.store.get_package(name, version), name, version
+
     def display_pkginfo(self, name=None, version=None):
         '''Reconstruct and send a PKG-INFO metadata file.
         '''


More information about the Pypi-checkins mailing list