[Mpuls-commits] r355 - in wasko/trunk: . waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 10 15:58:08 CET 2009


Author: teichmann
Date: 2009-03-10 15:58:06 +0100 (Tue, 10 Mar 2009)
New Revision: 355

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/waskaweb/lib/xmlhelper.py
Log:
Enable import of datetimes in logtimes.


Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-03-10 13:33:14 UTC (rev 354)
+++ wasko/trunk/ChangeLog.txt	2009-03-10 14:58:06 UTC (rev 355)
@@ -1,3 +1,9 @@
+2009-03-10	Sascha L. Teichmann	<teichmann at intevation.de>
+
+	* waskaweb/lib/xmlhelper.py: Replaced usage of datetime.strptime() 
+	  with a Python 2.4 equivalent function. This prevented import of dates
+	  in logbook entries.
+
 2009-03-10	Torsten Irlaender  <torsten.irlaender at intevation.de> 
 
 	* waskaweb/i18n/de/LC_MESSAGES/waskaweb.po: Changed versionstring to

Modified: wasko/trunk/waskaweb/lib/xmlhelper.py
===================================================================
--- wasko/trunk/waskaweb/lib/xmlhelper.py	2009-03-10 13:33:14 UTC (rev 354)
+++ wasko/trunk/waskaweb/lib/xmlhelper.py	2009-03-10 14:58:06 UTC (rev 355)
@@ -13,6 +13,7 @@
 from datetime import datetime, date
 
 import re
+import time
 
 NO_NUMBER  = re.compile("[^0-9\-]")
 INT_NUMBER = re.compile("(-?[0-9]+)")
@@ -24,7 +25,8 @@
         d.year, d.month, d.day, d.hour, d.minute, d.second)
 
 def string_iso_time(s):
-    return datetime.datetime.strptime(s.replace("-", ""), "%Y%m%dT%H:%M:%S")
+    #return datetime.strptime(s.replace("-", ""), "%Y%m%dT%H:%M:%S") # Python 2.5
+    return datetime(*(time.strptime(s.replace("-", ""), "%Y%m%dT%H:%M:%S")[0:6]))
 
 
 def decode_int(s):



More information about the Mpuls-commits mailing list