[Pypi-checkins] r735 - in trunk/pypi: . templates

richard python-checkins at python.org
Tue Feb 23 04:51:46 CET 2010


Author: richard
Date: Tue Feb 23 04:51:46 2010
New Revision: 735

Modified:
   trunk/pypi/templates/pkg_edit.pt
   trunk/pypi/webui.py
Log:
force presence of top-level index.html file

Modified: trunk/pypi/templates/pkg_edit.pt
==============================================================================
--- trunk/pypi/templates/pkg_edit.pt	(original)
+++ trunk/pypi/templates/pkg_edit.pt	Tue Feb 23 04:51:46 2010
@@ -92,7 +92,11 @@
 </form>
 
 <p>You can now host documentation at
-<a tal:attributes="href string:http://packages.python.org/${data/name}" tal:content="string:http://packages.python.org/${data/name}"></a>. To upload documentation, prepare a .zip file that is unpacked into this URL. Only static pages are supported. The directory index file is index.html.</p>
+<a tal:attributes="href string:http://packages.python.org/${data/name}"
+tal:content="string:http://packages.python.org/${data/name}"></a>. To
+upload documentation, prepare a .zip file that is unpacked into this URL.
+Only static pages are supported. The zip file must have a top-level
+"index.html".</p>
 <form tal:attributes="action app/url_path" method="POST"
     enctype="multipart/form-data">
 <input type="hidden" name=":action" value="doc_upload" />

Modified: trunk/pypi/webui.py
==============================================================================
--- trunk/pypi/webui.py	(original)
+++ trunk/pypi/webui.py	Tue Feb 23 04:51:46 2010
@@ -2227,6 +2227,9 @@
         except Exception,e:
             raise FormError, "Error uncompressing zipfile:" + str(e)
 
+        if 'index.html' not in members:
+            raise FormError, 'Error: top-level "index.html" missing in the zipfile'
+
         # Assume the file is valid; remove any previous data
         path = os.path.join(self.config.database_docs_dir, name, "")
         if os.path.exists(path):


More information about the Pypi-checkins mailing list