Revision: 6974 Author: nicdumz Date: 2009-06-21 09:30:53 +0000 (Sun, 21 Jun 2009)
Log Message: ----------- Avoid failing in flames when getting the version number if SVN was _never_ used
Modified Paths: -------------- trunk/pywikipedia/version.py
Modified: trunk/pywikipedia/version.py =================================================================== --- trunk/pywikipedia/version.py 2009-06-19 17:39:55 UTC (rev 6973) +++ trunk/pywikipedia/version.py 2009-06-21 09:30:53 UTC (rev 6974) @@ -32,8 +32,13 @@ import wikipedia d = wikipedia.__version__.split(' ') tag = '' - date = time.strptime('T'.join(d[3:5]), '%Y-%m-%dT%H:%M:%SZ') - rev = d[2] + ' (wikipedia.py)' + if d == '$Id$': + # wikipedia.py got imported without using svn + date = 'date unknown' + rev = '-1 (rev unknown)' + else: + date = time.strptime('T'.join(d[3:5]), '%Y-%m-%dT%H:%M:%SZ') + rev = d[2] + ' (wikipedia.py)' datestring = time.strftime('%b %d %Y, %H:%M:%S', date) cache = {'tag': tag, 'rev': rev, 'date': datestring} return cache