Update of /cvsroot/freevo/freevo/src/tv
In directory sc8-pr-cvs1:/tmp/cvs-serv27168

Modified Files:
        epg_xmltv.py 
Log Message:
Added patch from Erland Lewin to fix a timezone problem


Index: epg_xmltv.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/tv/epg_xmltv.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** epg_xmltv.py        14 Mar 2003 06:38:40 -0000      1.11
--- epg_xmltv.py        14 Mar 2003 16:34:23 -0000      1.12
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.12  2003/03/14 16:34:23  dischi
+ # Added patch from Erland Lewin to fix a timezone problem
+ #
  # Revision 1.11  2003/03/14 06:38:40  outlyer
  # Added (disabled) support for a simple favourites list. Basically, create
***************
*** 101,104 ****
--- 104,108 ----
  import traceback
  import cPickle as pickle
+ import calendar
  
  # Configuration file. Determines where to look for AVI/MP3 files, etc
***************
*** 329,345 ****
      # Is it the '+1' format?
      if tz[0] == '+' or tz[0] == '-':
!         secs = time.mktime(strptime.strptime(tval, xmltv.date_format_notz))
          adj_neg = int(tz) >= 0
          adj_secs = int(tz[1:3])*3600+ int(tz[3:5])*60
          if adj_neg:
-             #print 'timestr2secs_utc(%s): secs = %s - %s' % (str, secs, adj_secs)
              secs -= adj_secs
          else:
-             #print 'timestr2secs_utc(%s): secs = %s + %s' % (str, secs, adj_secs)
              secs += adj_secs
      else:
          # No, use the regular conversion
          secs = time.mktime(strptime.strptime(str, xmltv.date_format_tz))
-         #print 'timestr2secs_utc(%s): secs = %s' % (str, secs)
  
      return secs
--- 333,355 ----
      # Is it the '+1' format?
      if tz[0] == '+' or tz[0] == '-':
!         tmTuple = ( int(tval[0:4]), int(tval[4:6]), int(tval[6:8]), 
!                     int(tval[8:10]), int(tval[10:12]), 0, -1, -1, -1 )
!         secs = calendar.timegm( tmTuple )
! 
          adj_neg = int(tz) >= 0
          adj_secs = int(tz[1:3])*3600+ int(tz[3:5])*60
          if adj_neg:
              secs -= adj_secs
          else:
              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.
+ 
          secs = time.mktime(strptime.strptime(str, xmltv.date_format_tz))
  
      return secs




-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to