[py-svn] r35671 - in py/dist/py: documentation misc

arigo at codespeak.net arigo at codespeak.net
Wed Dec 13 13:36:41 CET 2006


Author: arigo
Date: Wed Dec 13 13:36:39 2006
New Revision: 35671

Modified:
   py/dist/py/documentation/confrest.py
   py/dist/py/misc/difftime.py
Log:
Tentative check-in.  Print the date of modification instead of the "X
days ago", which for PyPy's web site usually ends up as "47 seconds ago"
and stays this way until the next check-in.



Modified: py/dist/py/documentation/confrest.py
==============================================================================
--- py/dist/py/documentation/confrest.py	(original)
+++ py/dist/py/documentation/confrest.py	Wed Dec 13 13:36:39 2006
@@ -1,6 +1,6 @@
 import py
 from py.__.misc.rest import convert_rest_html, strip_html_header 
-from py.__.misc.difftime import worded_diff_time 
+from py.__.misc.difftime import worded_time 
 
 mydir = py.magic.autopath().dirpath()
 html = py.xml.html 
@@ -105,7 +105,7 @@
 
         try:
             svninfo = txtpath.info() 
-            modified = " modified %s by %s" % (worded_diff_time(svninfo.mtime),
+            modified = " modified %s by %s" % (worded_time(svninfo.mtime),
                                                getrealname(svninfo.last_author))
         except (KeyboardInterrupt, SystemExit): 
             raise

Modified: py/dist/py/misc/difftime.py
==============================================================================
--- py/dist/py/misc/difftime.py	(original)
+++ py/dist/py/misc/difftime.py	Wed Dec 13 13:36:39 2006
@@ -23,3 +23,10 @@
         plural = div > 1 and 's' or ''
         l.append('%d %s%s' %(div, _time_desc[key], plural))
     return ", ".join(l) + " ago "
+
+_months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+           'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+
+def worded_time(ctime):
+    tm = py.std.time.gmtime(ctime)
+    return "%s %d, %d" % (_months[tm.tm_mon-1], tm.tm_mday, tm.tm_year)


More information about the py-svn mailing list