[Pywikipedia-l] SVN: [5347] trunk/pywikipedia/checkimages.py

filnik at svn.wikimedia.org filnik at svn.wikimedia.org
Sat May 10 12:38:34 UTC 2008


Revision: 5347
Author:   filnik
Date:     2008-05-10 12:38:34 +0000 (Sat, 10 May 2008)

Log Message:
-----------
Minifix for the data detection

Modified Paths:
--------------
    trunk/pywikipedia/checkimages.py

Modified: trunk/pywikipedia/checkimages.py
===================================================================
--- trunk/pywikipedia/checkimages.py	2008-05-10 00:29:16 UTC (rev 5346)
+++ trunk/pywikipedia/checkimages.py	2008-05-10 12:38:34 UTC (rev 5347)
@@ -722,7 +722,10 @@
                     DupePage = wikipedia.ImagePage(self.site, u'Image:%s' % duplicate)
                     imagedata = DupePage.getFileVersionHistory()[-1][0]
                     # Example: 21:15, 5 ott 2005
-                    data = time.strptime(imagedata, "%H:%M, %d %b %Y")
+                    try:
+                        data = time.strptime(imagedata, "%H:%M, %d %b %Y")
+                    except ValueError:
+                        data = time.strptime(imagedata, "%H:%M, %d %B %Y")
                     data_seconds = time.mktime(data)
                     time_image_list.append([data_seconds, self.image])
                     time_list.append(data_seconds)





More information about the Pywikipedia-l mailing list