From python-checkins at python.org Sat Apr 2 19:13:09 2011
From: python-checkins at python.org (martin.von.loewis)
Date: Sat, 2 Apr 2011 19:13:09 +0200 (CEST)
Subject: [Pypi-checkins] r898 - trunk/pypi
Message-ID: <3Q25kY5tTcz7LkN@mail.python.org>
Author: martin.von.loewis
Date: Sat Apr 2 19:13:09 2011
New Revision: 898
Modified:
trunk/pypi/webui.py
Log:
Don't directly call display for single-item search
results; redirect instead.
Modified: trunk/pypi/webui.py
==============================================================================
--- trunk/pypi/webui.py (original)
+++ trunk/pypi/webui.py Sat Apr 2 19:13:09 2011
@@ -1527,9 +1527,7 @@
scores[k[0]] = v[0]
if len(l) == 1:
- self.form['name'] = l[0][-1]['name']
- self.form['version'] = l[0][-1]['version']
- return self.display()
+ raise RedirectTemporary, "%s/%s/%s" % (self.config.url,l[0][-1]['name'],l[0][-1]['version'])
# sort and pull out just the record
l.sort()
From python-checkins at python.org Wed Apr 6 04:43:36 2011
From: python-checkins at python.org (richard)
Date: Wed, 6 Apr 2011 04:43:36 +0200 (CEST)
Subject: [Pypi-checkins] r899 - in trunk/pypi: . templates
Message-ID: <3Q4BFN0pdvzRnt@mail.python.org>
Author: richard
Date: Wed Apr 6 04:43:35 2011
New Revision: 899
Added:
trunk/pypi/templates/about.pt
Modified:
trunk/pypi/webui.py
Log:
add an About page
Added: trunk/pypi/templates/about.pt
==============================================================================
--- (empty file)
+++ trunk/pypi/templates/about.pt Wed Apr 6 04:43:35 2011
@@ -0,0 +1,70 @@
+
+
+
+
+Welcome to pypi.python.org, the Python community's software hosting service.
+
+Here you'll find a Python package to suit almost any need.
+
+The project was started in 2002 by Richard Jones,
+and has since grown to include the contributions of over a dozen Python
+programmers, packages
+and millions of downloads.
+
+The Python Package Index (PyPI) is hosted by the Python Software Foundation (who run the python.org systems) but the project is community-run. Currently there's two maintainers, Richard and Martin von L?wis.
+
+The index itself is written in Python but pre-dates modern Python web frameworks.
+
+
+To contact the admins, please
+use the
+Get help
+or
+Bug reports
+links.
+ To submit a package use
+"python setup.py upload"
+and to use a package from this index either
+"pip install package"
+or download, unpack and "python setup.py install" it.
+ PyPI now provides a Mirror infrastructure to allow
+users to continue downloading file even if pypi.python.org is unavailable.
+PyPI has also been known as The Python Cheese Shop (and indeed cheeseshop.python.org still works).
+ And now for something completely different...
+Customer: Now then, some cheese please, my good man.
+About
+
+Owner: (lustily) Certainly, sir. What would you like?
+
+Customer: Well, eh, how about a little red Leicester.
+
+Owner: I'm, a-fraid we're fresh out of red Leicester, sir.
+
-The project was started in 2002 by Richard Jones, +The project was started in 2002, and has since grown to include the contributions of over a dozen Python programmers, packages and millions of downloads.
-The Python Package Index (PyPI) is hosted by the Python Software Foundation (who run the python.org systems) but the project is community-run. Currently there's two maintainers, Richard and Martin von L?wis. +The Python Package Index (PyPI) is hosted by the Python Software Foundation (who run the python.org systems) but the project is community-run. Currently there's two maintainers, Richard Jones and Martin von L?wis.
-The index itself is written in Python but pre-dates modern Python web frameworks. - +The index itself is written in Python but pre-dates modern Python web frameworks (more detail).
From python-checkins at python.org Wed Apr 6 04:49:32 2011 From: python-checkins at python.org (richard) Date: Wed, 6 Apr 2011 04:49:32 +0200 (CEST) Subject: [Pypi-checkins] r901 - trunk/pypi/templates Message-ID: <3Q4BND511Sz7LjM@mail.python.org> Author: richard Date: Wed Apr 6 04:49:32 2011 New Revision: 901 Modified: trunk/pypi/templates/about.pt Log: tweaks Modified: trunk/pypi/templates/about.pt ============================================================================== --- trunk/pypi/templates/about.pt (original) +++ trunk/pypi/templates/about.pt Wed Apr 6 04:49:32 2011 @@ -25,13 +25,6 @@
The Python Package Index (PyPI) is hosted by the Python Software Foundation (who run the python.org systems) but the project is community-run. Currently there's two maintainers, Richard Jones and Martin von L?wis. -
- --The index itself is written in Python but pre-dates modern Python web frameworks (more detail). -
- -To contact the admins, please use the Get help @@ -40,6 +33,10 @@ links.
++The index itself is written in Python but pre-dates modern Python web frameworks (more detail). +
+To submit a package use
"python setup.py upload"
and to use a package from this index either
From python-checkins at python.org Wed Apr 6 20:32:53 2011
From: python-checkins at python.org (martin.von.loewis)
Date: Wed, 6 Apr 2011 20:32:53 +0200 (CEST)
Subject: [Pypi-checkins] r902 - trunk/pypi
Message-ID: <3Q4bJj2CTVz7Lkw@mail.python.org>
Author: martin.von.loewis
Date: Wed Apr 6 20:32:52 2011
New Revision: 902
Modified:
trunk/pypi/mirrors.txt
Log:
Update C IP address.
Modified: trunk/pypi/mirrors.txt
==============================================================================
--- trunk/pypi/mirrors.txt (original)
+++ trunk/pypi/mirrors.txt Wed Apr 6 20:32:52 2011
@@ -1,4 +1,4 @@
b: 141.89.226.2, martin at v.loewis.de
-c: h1606280.stratoserver.net, pypi at zopyx.com
+c: 178.77.74.179, pypi at zopyx.com
d: pypi.websushi.org, jezdez+pypi at enn.io
From python-checkins at python.org Wed Apr 6 20:34:51 2011
From: python-checkins at python.org (martin.von.loewis)
Date: Wed, 6 Apr 2011 20:34:51 +0200 (CEST)
Subject: [Pypi-checkins] r903 - in trunk/pypi: . templates
Message-ID: <3Q4bLz3p6Vz7Llg@mail.python.org>
Author: martin.von.loewis
Date: Wed Apr 6 20:34:51 2011
New Revision: 903
Removed:
trunk/pypi/templates/comment.pt
Modified:
trunk/pypi/admin.py
trunk/pypi/rpc.py
trunk/pypi/store.py
trunk/pypi/templates/display.pt
trunk/pypi/templates/pkg_edit.pt
trunk/pypi/webui.py
Log:
Remove rating feature.
Modified: trunk/pypi/admin.py
==============================================================================
--- trunk/pypi/admin.py (original)
+++ trunk/pypi/admin.py Wed Apr 6 20:34:51 2011
@@ -97,15 +97,6 @@
print "Deleting", path
shutil.rmtree(path)
-def send_comments(store):
- '''Send out comments to package owners. Normally, this will
- be done automatically, but the very first comments had not been sent.'''
- import webui
- c = store.get_cursor()
- c.execute("select name, version, user_name, message from ratings where message!=''")
- for package, version, author, comment in c.fetchall():
- webui.comment_email(store, package, version, author, comment)
-
def merge_user(store, old, new):
c = store.get_cursor()
if not store.get_user(old):
Modified: trunk/pypi/rpc.py
==============================================================================
--- trunk/pypi/rpc.py (original)
+++ trunk/pypi/rpc.py Wed Apr 6 20:34:51 2011
@@ -24,7 +24,6 @@
self.register_function(updated_releases)
self.register_function(changelog)
self.register_function(post_cheesecake_for_release)
- self.register_function(ratings)
self.register_introspection_functions()
self.register_multicall_functions()
@@ -120,16 +119,4 @@
store.save_cheesecake_score(name, version, score_data)
store.commit()
-def ratings(store, name, version, since):
- ratings, comments = store.all_ratings(name, version, since)
- for i, r in enumerate(ratings):
- r = list(r)
- r[3] = int(time.mktime(r[3].timetuple()))
- ratings[i] = tuple(r)
- for i, c in enumerate(comments):
- c = list(c)
- c[5] = int(time.mktime(c[5].timetuple()))
- comments[i] = c
- return ratings, comments
-
handle_request = RequestHandler()
Modified: trunk/pypi/store.py
==============================================================================
--- trunk/pypi/store.py (original)
+++ trunk/pypi/store.py Wed Apr 6 20:34:51 2011
@@ -788,17 +788,6 @@
project_urls.append(project[0].split(','))
return project_urls
- def get_package_comments(self, name):
- cursor = self.get_cursor()
- safe_execute(cursor, 'select comments from packages where name=%s',
- [name])
- return cursor.fetchall()[0][0]
-
- def set_package_comments(self, name, value):
- cursor = self.get_cursor()
- safe_execute(cursor, 'update packages set comments=%s where name=%s',
- [value, name])
-
def get_unique(self, iterable):
''' Iterate over list of (name,version,date,summary) tuples
and return list of unique (taking name and version into
@@ -1082,168 +1071,6 @@
self.username,
self.userip))
- def add_rating(self, name, version, rating, message):
- '''Add a user rating of a release; message is optional'''
- cursor = self.get_cursor()
- safe_execute(cursor, '''insert into ratings (name, version, user_name, date, rating)
- values(%s, %s, %s, current_timestamp, %s)''', (name, version, self.username, rating))
- if message:
- safe_execute(cursor, '''insert into comments(rating, user_name, date, message, in_reply_to)
- values(%s, %%s, current_timestamp, %%s, NULL)'''
- % self.last_id('ratings'),
- (self.username, message))
- safe_execute(cursor, '''insert into comments_journal(name, version, id, submitted_by, date, action)
- values(%%s, %%s, %s, %%s, current_timestamp, %%s)'''
- % self.last_id('comments'),
- (name, version, self.username, 'add_rating %r' % message))
-
- def copy_rating(self, name, fromversion, toversion):
- '''Copy a user-s rating of package name from one version to another;
- return the comment if any'''
- cursor = self.get_cursor()
- safe_execute(cursor, '''insert into ratings(name,version,user_name,date,rating)
- select name,%s,user_name,current_timestamp,rating from ratings
- where name=%s and version=%s and user_name=%s''',
- (toversion, name, fromversion, self.username))
- # only copy comment, not follow-ups
- safe_execute(cursor, 'select c.id from comments c, ratings r where c.rating=r.id and r.name=%s and r.version=%s', (name, fromversion))
- cid = cursor.fetchone()
- if cid:
- cid = cid[0]
- safe_execute(cursor, '''insert into comments(rating, user_name, date, message, in_reply_to)
- select %s, user_name, date, message, in_reply_to
- from comments where id=%%s''' % self.last_id('ratings'), (cid,))
- safe_execute(cursor, '''insert into comments_journal(name, version, id, submitted_by, date, action)
- values(%%s, %%s, %s, %%s, current_timestamp, %%s)''' % self.last_id('comments'),
- (name, toversion, self.username, 'copied %s' % cid))
-
- safe_execute(cursor, '''select message from comments
- where id=%s''', (cid,))
- return cursor.fetchone()[0]
- return None
-
- def remove_rating(self, name, version):
- '''Remove a rating for the current user'''
- cursor = self.get_cursor()
- safe_execute(cursor, """insert into comments_journal(name, version, id, submitted_by, date, action)
- select %s, %s, id, %s, current_timestamp, 'deleted' from ratings where user_name=%s and name=%s and version=%s""",
- (name, version, self.username, self.username, name, version))
- safe_execute(cursor, "delete from ratings where user_name=%s and name=%s and version=%s",
- (self.username, name, version))
-
- _Rating=FastResultRow('id! date! user rating!')
- _Comment=FastResultRow('id! rating! user date! message in_reply_to!')
- def get_ratings(self, name, version):
- '''Return ratings,messages for a release.'''
- cursor = self.get_cursor()
- safe_execute(cursor, '''select id, date, user_name, rating from ratings
- where name=%s and version=%s order by date''', (name, version))
- res = cursor.fetchall()
- safe_execute(cursor, '''select c.id, c.rating, c.user_name, c.date, c.message, c.in_reply_to from
- ratings r, comments c where r.name=%s and r.version=%s and r.id=c.rating order by c.date''', (name, version))
- res2 = cursor.fetchall()
- return Result(None, res, self._Rating), Result(None, res2, self._Comment)
-
- def get_comment(self, id):
- '''Return a single comment.'''
- cursor = self.get_cursor()
- safe_execute(cursor, '''select id, rating, user_name, date, message, in_reply_to from
- comments where id=%s''', (id,))
- res = cursor.fetchall()
- if res:
- return self._Comment(None, res[0])
- else:
- return None
-
- def add_comment(self, msg, comment):
- "Add a comment as a reply to msg. Return name and version"
- cursor = self.get_cursor()
- safe_execute(cursor, "select c.rating, r.name, r.version from comments c, ratings r where c.id=%s and c.rating=r.id", (msg,))
- rating, name, version = cursor.fetchone()
- safe_execute(cursor, '''insert into comments(rating, user_name, date, message, in_reply_to)
- values(%s,%s,current_timestamp,%s,%s)''', (rating, self.username, comment, msg))
- safe_execute(cursor, '''insert into comments_journal(name, version, id, submitted_by, date, action)
- values(%%s, %%s, %s, %%s, current_timestamp, %%s)''' % self.last_id('comments'),
- (name, version, self.username, 'add %s %r' % (msg, comment)))
- return name, version
-
- def remove_comment(self, msg):
- "Delete a comment and all its follow-ups."
- cursor = self.get_cursor()
- safe_execute(cursor, "select r.name, r.version from ratings r, comments c where c.id=%s and r.id=c.rating", (msg,))
- name, version = cursor.fetchone()
- safe_execute(cursor, "delete from comments where id=%s", (msg,))
- safe_execute(cursor, '''insert into comments_journal(name, version, id, submitted_by, date, action)
- values(%s, %s, %s, %s, current_timestamp, 'delete')''', (name, version, msg, self.username))
-
- def has_package_comments(self, name):
- "Return true if the package has any comments"
- cursor = self.get_cursor()
- safe_execute(cursor, """select r.name,count(*) from ratings r,comments c
- where r.id=c.rating and r.name=%s group by(r.name)""", (name,))
- return len(cursor.fetchall()) > 0
-
- def get_package_commenters(self, name):
- "Return the email addresses of all commenters on a package."
- cursor = self.get_cursor()
- safe_execute(cursor, """select distinct(email) from ratings r,comments c,users u
- where r.id=c.rating and r.name=%s and c.user_name=u.name""", (name,))
- return [r[0] for r in cursor.fetchall()]
-
- _AllRatings=FastResultRow('name version user_name date! rating! message')
- def all_ratings(self, name, version, date):
- '''Return all ratings since UTC timestamp. name and version may be None.'''
- cursor = self.get_cursor()
- date = time.strftime('%Y-%m-%d %H:%M:%S +0000', time.gmtime(date))
- if name:
- if version:
- safe_execute(cursor, '''select name, version, user_name, date, rating
- from ratings where name=%s and version=%s and date > %s''', (name, version, date))
- ratings = cursor.fetchall()
- safe_execute(cursor, '''select c.id, c.in_reply_to, r.name, r.version,
- c.user_name, c.date, c.message
- from ratings r, comments c where
- r.name=%s and r.version=%s and r.id=c.rating and c.date > %s''',
- (name, version, date))
- comments = cursor.fetchall()
- else:
- safe_execute(cursor, '''select name, version, user_name, date, rating
- from ratings where name=%s and date > %s''', (name,date))
- ratings = cursor.fetchall()
- safe_execute(cursor, '''select c.id, c.in_reply_to, r.name, r.version,
- c.user_name, c.date, c.message
- from ratings r, comments c where
- r.name=%s and r.id=c.rating and c.date > %s''',
- (name, date))
- comments = cursor.fetchall()
- else:
- safe_execute(cursor, '''select name, version, user_name, date, rating
- from ratings where date > %s''', (date,))
- ratings = cursor.fetchall()
- safe_execute(cursor, '''select c.id, c.in_reply_to, r.name, r.version,
- c.user_name, c.date, c.message
- from ratings r, comments c where
- r.id=c.rating and c.date > %s''', (date,))
- comments = cursor.fetchall()
- return ratings, comments
-
- def has_rating(self, name, version):
- '''Check whether user has rated this release'''
- cursor = self.get_cursor()
- safe_execute(cursor, '''select count(*) from ratings
- where user_name=%s and name=%s and version=%s''', (self.username, name, version))
- return cursor.fetchall()[0][0]
-
- def latest_rating(self, name):
- '''Return the user-s latest rating on any release, or None.'''
- cursor = self.get_cursor()
- safe_execute(cursor, '''select version from ratings
- where user_name=%s and name=%s order by date desc limit 1''', (self.username, name))
- res = cursor.fetchone()
- if res:
- res = res[0]
- return res
-
def save_cheesecake_score(self, name, version, score_data):
'''Save Cheesecake score for a release.
'''
Deleted: /trunk/pypi/templates/comment.pt
==============================================================================
--- /trunk/pypi/templates/comment.pt Wed Apr 6 20:34:51 2011
+++ (empty file)
@@ -1,26 +0,0 @@
-
-
-
-
- The comment from said Your reply:
-
Note:If deletes the original message, your response to it will also get deleted.
- - Modified: trunk/pypi/templates/display.pt ============================================================================== --- trunk/pypi/templates/display.pt (original) +++ trunk/pypi/templates/display.pt Wed Apr 6 20:34:51 2011 @@ -244,72 +244,7 @@ -Log in to rate this package.
-Ratings range from 0 to 5 (best).
-