[Python-checkins] r59976 - peps/trunk/pep2rss.py

andrew.kuchling python-checkins at python.org
Tue Jan 15 14:56:50 CET 2008


Author: andrew.kuchling
Date: Tue Jan 15 14:56:50 2008
New Revision: 59976

Modified:
   peps/trunk/pep2rss.py
Log:
Cosmetic patch from Frank Benksten:
* Show most recent items in reverse order so the newest item is at the top.


Modified: peps/trunk/pep2rss.py
==============================================================================
--- peps/trunk/pep2rss.py	(original)
+++ peps/trunk/pep2rss.py	Tue Jan 15 14:56:50 2008
@@ -36,11 +36,12 @@
         t = time.strptime(created_str, '%d-%B-%Y')
     return datetime.datetime(*t[:6])
 peps_with_dt = [(pep_creation_dt(full_path), full_path) for full_path in peps]
-peps_with_dt.sort()
+# sort peps by date, newest first
+peps_with_dt.sort(reverse=True)
 
 # generate rss items for 10 most recent peps
 items = []
-for dt, full_path in peps_with_dt[-10:]:
+for dt, full_path in peps_with_dt[:10]:
     try:
         n = int(full_path.split('-')[-1].split('.')[0])
     except ValueError:


More information about the Python-checkins mailing list