Modified: branches/tarek-pep-345-support/webui.py
==============================================================================
--- branches/tarek-pep-345-support/webui.py (original)
+++ branches/tarek-pep-345-support/webui.py Wed Mar 17 03:04:09 2010
@@ -1211,7 +1211,7 @@
# Compute rating data
has_rated = self.loggedin and self.store.has_rating(name, version)
- latest_rating = self.loggedin and self.store.latest_rating(name)
+ latest_rating = self.loggedin and self.store.latest_rating(name)
ratings, comments = self.store.get_ratings(name, version)
total = 0.0
hcomments = [] # as a hierarchy
@@ -1223,6 +1223,11 @@
total += r['rating']
tally[r['rating']] += 1
+ # New metadata
+ requires_dist = self.store.get_package_requires_dist(name, version)
+ provides_dist = self.store.get_package_provides_dist(name, version)
+ project_url = self.store.get_package_project_url(name, version)
+
for c in comments:
add = c, []
parent_comments[c['id']] = add[1]
@@ -1288,7 +1293,10 @@
usinglatest=using_latest,
latestversion=latest_version,
latestversionurl=latest_version_url,
- action=self.link_action())
+ action=self.link_action(),
+ requires_dist=requires_dist,
+ provides_dist=provides_dist,
+ project_url=project_url)
def index(self, nav_current='index', releases=None):
''' Print up an index page
From python-checkins at python.org Wed Mar 17 03:27:38 2010
From: python-checkins at python.org (tarek.ziade)
Date: Wed, 17 Mar 2010 03:27:38 +0100 (CET)
Subject: [Pypi-checkins] r746 - branches/tarek-pep-345-support
Message-ID: <20100317022738.EDEC1FA1E@mail.python.org>
Author: tarek.ziade
Date: Wed Mar 17 03:27:38 2010
New Revision: 746
Modified:
branches/tarek-pep-345-support/README
branches/tarek-pep-345-support/pypi.wsgi
Log:
make it simple to run pypi.wsgi, using wsgiref, and added more detail in README
Modified: branches/tarek-pep-345-support/README
==============================================================================
--- branches/tarek-pep-345-support/README (original)
+++ branches/tarek-pep-345-support/README Wed Mar 17 03:27:38 2010
@@ -1,7 +1,7 @@
Required packages
-----------------
-To run the PyPI software, you need PostgreSQL, and all
+To run the PyPI software, you need PostgreSQL, and all
these packages located at PyPI:
- cElementTree
@@ -10,13 +10,34 @@
- zope.tal
- zope.tales
- zope.i18nmessageid
-- psycopg2
+- psycopg2
- M2Crypto
- BeautifulSoup
+- docutils
-You can create a development environment like this, if you
-have virtualenv installed::
+Quick development setup
+-----------------------
+
+Make sure you read http://wiki.python.org/moin/CheeseShopDev#DevelopmentEnvironmentHints
+and you have a working PostgreSQL DB.
+
+Make sure your config.ini is up-to-date. Change CONFIG_FILE at the begining
+of pypi.wsgi, so it looks like this::
+
+ CONFIG_FILE = 'config.ini'
+
+Then, you can create a development environment like this, if you have
+virtualenv installed::
$ virtualenv --no-site-packages --distribute .
- $ bin/easy_install cElementTree zope.interface zope.pagetemplate zope.tal zope.tales zope.i18nmessageid psycopg2 M2Crypto BeautifulSoup
+ $ bin/easy_install cElementTree zope.interface zope.pagetemplate
+ $ bin/easy_install zope.tal zope.tales zope.i18nmessageid psycopg2
+ $ bin/easy_install M2Crypto BeautifulSoup docutils
+
+Then you can launch the server using the pypi.wsgi script::
+
+ $ bin/python pypi.wsgi
+ Serving on port 8000...
+
+PyPI will be available in your browser at http://localhost:8000
Modified: branches/tarek-pep-345-support/pypi.wsgi
==============================================================================
--- branches/tarek-pep-345-support/pypi.wsgi (original)
+++ branches/tarek-pep-345-support/pypi.wsgi Wed Mar 17 03:27:38 2010
@@ -6,18 +6,21 @@
store.keep_conn = True
+CONFIG_FILE = '/data/pypi/config.ini'
+
class Request:
def __init__(self, environ, start_response):
self.start_response = start_response
- self.rfile = cStringIO.StringIO(environ['wsgi.input'].read())
+ length = int(environ['CONTENT_LENGTH'])
+ self.rfile = cStringIO.StringIO(environ['wsgi.input'].read(length))
self.wfile = cStringIO.StringIO()
- self.config = config.Config('/data/pypi/config.ini')
-
+ self.config = config.Config(CONFIG_FILE )
+
def send_response(self, code, message='no details available'):
self.status = '%s %s' % (code, message)
self.headers = []
-
+
def send_header(self, keyword, value):
self.headers.append((keyword, value))
@@ -47,3 +50,11 @@
r = Request(environ, start_response)
webui.WebUI(r, environ).run()
return [r.wfile.getvalue()]
+
+if __name__ == '__main__':
+ # very simple wsgi server so we can play locally
+ from wsgiref.simple_server import make_server
+ httpd = make_server('', 8000, application)
+ print "Serving on port 8000..."
+ httpd.serve_forever()
+
From python-checkins at python.org Wed Mar 17 05:14:09 2010
From: python-checkins at python.org (tarek.ziade)
Date: Wed, 17 Mar 2010 05:14:09 +0100 (CET)
Subject: [Pypi-checkins] r747 - branches/tarek-pep-345-support
Message-ID: <20100317041409.BAD6FFA77@mail.python.org>
Author: tarek.ziade
Date: Wed Mar 17 05:14:09 2010
New Revision: 747
Modified:
branches/tarek-pep-345-support/pypi.wsgi
Log:
handle request with empty data
Modified: branches/tarek-pep-345-support/pypi.wsgi
==============================================================================
--- branches/tarek-pep-345-support/pypi.wsgi (original)
+++ branches/tarek-pep-345-support/pypi.wsgi Wed Mar 17 05:14:09 2010
@@ -6,13 +6,16 @@
store.keep_conn = True
-CONFIG_FILE = '/data/pypi/config.ini'
+CONFIG_FILE = 'config.ini'
class Request:
def __init__(self, environ, start_response):
self.start_response = start_response
- length = int(environ['CONTENT_LENGTH'])
+ try:
+ length = int(environ['CONTENT_LENGTH'])
+ except ValueError:
+ length = 0
self.rfile = cStringIO.StringIO(environ['wsgi.input'].read(length))
self.wfile = cStringIO.StringIO()
self.config = config.Config(CONFIG_FILE )
From python-checkins at python.org Sun Mar 21 00:00:25 2010
From: python-checkins at python.org (tarek.ziade)
Date: Sun, 21 Mar 2010 00:00:25 +0100 (CET)
Subject: [Pypi-checkins] r748 - branches/tarek-pep-345-support/templates
Message-ID: <20100320230025.4C5C1F908@mail.python.org>
Author: tarek.ziade
Date: Sun Mar 21 00:00:25 2010
New Revision: 748
Modified:
branches/tarek-pep-345-support/templates/display.pt
branches/tarek-pep-345-support/templates/standard_template.pt
Log:
removed trailing spaces
Modified: branches/tarek-pep-345-support/templates/display.pt
==============================================================================
--- branches/tarek-pep-345-support/templates/display.pt (original)
+++ branches/tarek-pep-345-support/templates/display.pt Sun Mar 21 00:00:25 2010
@@ -157,6 +157,7 @@
+
Requires
+
+
Package Index Owner:
Modified: branches/tarek-pep-345-support/templates/standard_template.pt
==============================================================================
--- branches/tarek-pep-345-support/templates/standard_template.pt (original)
+++ branches/tarek-pep-345-support/templates/standard_template.pt Sun Mar 21 00:00:25 2010
@@ -1,6 +1,6 @@
@@ -20,7 +20,7 @@
-
+