Hi,
I found this comment in the kaa/epg/src/sources/xmltv.py:
## WARNING! BUG HERE!
# The line below is incorrect; the strptime.strptime function
doesn't
# handle time zones. There is no obvious function that does.
Therefore
# this bug is left in for someone else to solve.
So I tried to solve it. Attached you can find the patch which worked for
me and should work for others as well.
Regards,
Jose
Index: xmltv.py
===================================================================
--- xmltv.py (revision 2597)
+++ xmltv.py (working copy)
@@ -171,9 +171,6 @@
tval = timestr
tz = str(-time.timezone/3600)
- if tz == 'CET':
- tz='+1'
-
# Is it the '+1' format?
if tz[0] == '+' or tz[0] == '-':
tmTuple = ( int(tval[0:4]), int(tval[4:6]), int(tval[6:8]),
@@ -194,17 +191,12 @@
secs += adj_secs
else:
# No, use the regular conversion
-
- ## WARNING! BUG HERE!
- # The line below is incorrect; the strptime.strptime function doesn't
- # handle time zones. There is no obvious function that does. Therefore
- # this bug is left in for someone else to solve.
-
try:
- secs = time.mktime(time.strptime(timestr,'%Y-%m-%d %H:%M:%S'))
+ secs = time.mktime(time.strptime(timestr,'%Y%m%d%H%M%S %Z'))
except ValueError:
- timestr = timestr.replace('EST', '')
- secs = time.mktime(time.strptime(timestr,'%Y-%m-%d %H:%M:%S'))
+ #try without the timezone
+ secs = time.mktime(time.strptime(tval,'%Y%m%d%H%M%S'))
+
return float(secs)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel