Mercurial > hg > MPIWGWeb
diff SrvTxtUtils.py @ 16:54f135c1ed65
updated MPIWGFeature.
zpts moved to feature subfolder and renamed.
new date attribute.
nicer management interface.
author | casties |
---|---|
date | Fri, 05 Apr 2013 15:58:43 +0200 |
parents | bca61e893fcc |
children | e40ff9829108 |
line wrap: on
line diff
--- a/SrvTxtUtils.py Fri Mar 08 16:17:58 2013 +0100 +++ b/SrvTxtUtils.py Fri Apr 05 15:58:43 2013 +0200 @@ -10,8 +10,34 @@ import urllib2 import logging +srvTxtUtilsVersion = "1.6" -srvTxtUtilsVersion = "1.5" +map_months = {'en': [u"", + u"January", + u"February", + u"March", + u"April", + u"May", + u"June", + u"July", + u"August", + u"September", + u"October", + u"November", + u"December"], + 'de': [u"", + u"Januar", + u"Februar", + u"M\u00e4rz", + u"April", + u"Mai", + u"Juni", + u"Juli", + u"August", + u"September", + u"Oktober", + u"November", + u"Dezember"]} def getInt(number, default=0): """returns always an int (0 in case of problems)""" @@ -73,7 +99,9 @@ return text - +def getMonthName(mon, lang): + """returns the name of the month mon in the language lang""" + return map_months[lang][mon] def getHttpData(url, data=None, num_tries=3, timeout=10, noExceptions=False): """returns result from url+data HTTP request"""