Update of /cvsroot/freevo/freevo/src/helpers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19430

Modified Files:
        recordserver.py 
Log Message:
fix crashes on debug (unicode again)

Index: recordserver.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/helpers/recordserver.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** recordserver.py     13 Mar 2004 03:28:32 -0000      1.35
--- recordserver.py     13 Mar 2004 22:36:44 -0000      1.36
***************
*** 7,10 ****
--- 7,13 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.36  2004/03/13 22:36:44  dischi
+ # fix crashes on debug (unicode again)
+ #
  # Revision 1.35  2004/03/13 03:28:32  outlyer
  # Someone must have fixed the str2XML part internal to the FxdIMDB code, since
***************
*** 205,211 ****
  os.environ['LD_PRELOAD'] = ''
  
! DEBUG = config.DEBUG
  
! if DEBUG: print 'PLUGIN_RECORD: %s' % config.plugin_record
  
  appname = os.path.splitext(os.path.basename(sys.argv[0]))[0]
--- 208,217 ----
  os.environ['LD_PRELOAD'] = ''
  
! def _debug_(text):
!     if config.DEBUG:
!         log.debug(String(text))
!         
  
! _debug_('PLUGIN_RECORD: %s' % config.plugin_record)
  
  appname = os.path.splitext(os.path.basename(sys.argv[0]))[0]
***************
*** 224,229 ****
  
          if os.path.isfile(config.TV_RECORD_SCHEDULE):
!             if DEBUG:
!                 log.debug('GET: reading cached file (%s)' % 
config.TV_RECORD_SCHEDULE)
              f = open(config.TV_RECORD_SCHEDULE, 'r')
              scheduledRecordings = unjellyFromXML(f)
--- 230,234 ----
  
          if os.path.isfile(config.TV_RECORD_SCHEDULE):
!             _debug_('GET: reading cached file (%s)' % config.TV_RECORD_SCHEDULE)
              f = open(config.TV_RECORD_SCHEDULE, 'r')
              scheduledRecordings = unjellyFromXML(f)
***************
*** 233,254 ****
                  file_ver = scheduledRecordings.TYPES_VERSION
              except AttributeError:
!                 log.debug('The cache does not have a version and must be recreated.')
      
              if file_ver != TYPES_VERSION:
!                 log.debug(('ScheduledRecordings version number %s is stale (new is 
%s), must ' +
                          'be reloaded') % (file_ver, TYPES_VERSION))
                  scheduledRecordings = None
              else:
!                 if DEBUG:
!                     log.debug('Got ScheduledRecordings (version %s).' % file_ver)
      
          if not scheduledRecordings:
!             if DEBUG: log.debug('GET: making a new ScheduledRecordings')
              scheduledRecordings = ScheduledRecordings()
              self.saveScheduledRecordings(scheduledRecordings)
      
!         if DEBUG:
!             log.debug('ScheduledRecordings has %s items.' % \
!                       len(scheduledRecordings.programList))
      
          return scheduledRecordings
--- 238,257 ----
                  file_ver = scheduledRecordings.TYPES_VERSION
              except AttributeError:
!                 _debug_('The cache does not have a version and must be recreated.')
      
              if file_ver != TYPES_VERSION:
!                 _debug_(('ScheduledRecordings version number %s is stale (new is 
%s), must ' +
                          'be reloaded') % (file_ver, TYPES_VERSION))
                  scheduledRecordings = None
              else:
!                 _debug_('Got ScheduledRecordings (version %s).' % file_ver)
      
          if not scheduledRecordings:
!             _debug_('GET: making a new ScheduledRecordings')
              scheduledRecordings = ScheduledRecordings()
              self.saveScheduledRecordings(scheduledRecordings)
      
!         _debug_('ScheduledRecordings has %s items.' % \
!                 len(scheduledRecordings.programList))
      
          return scheduledRecordings
***************
*** 261,272 ****
      
          if not scheduledRecordings:
!             if DEBUG: print 'SAVE: making a new ScheduledRecordings'
              scheduledRecordings = ScheduledRecordings()
      
!         if DEBUG:
!             log.debug('SAVE: saving cached file (%s)' % config.TV_RECORD_SCHEDULE)
!         if DEBUG:
!             log.debug("SAVE: ScheduledRecordings has %s items." % \
!                       len(scheduledRecordings.programList))
          f = open(config.TV_RECORD_SCHEDULE, 'w')
          jellyToXML(scheduledRecordings, f)
--- 264,273 ----
      
          if not scheduledRecordings:
!             _debug_('SAVE: making a new ScheduledRecordings')
              scheduledRecordings = ScheduledRecordings()
      
!         _debug_('SAVE: saving cached file (%s)' % config.TV_RECORD_SCHEDULE)
!         _debug_("SAVE: ScheduledRecordings has %s items." % \
!                 len(scheduledRecordings.programList))
          f = open(config.TV_RECORD_SCHEDULE, 'w')
          jellyToXML(scheduledRecordings, f)
***************
*** 288,292 ****
          for chan in guide.chan_list:
              if prog.channel_id == chan.id:
!                 if DEBUG: log.debug('scheduleRecording: prog.channel_id="%s" 
chan.id="%s" chan.tunerid="%s"' % (prog.channel_id, chan.id, chan.tunerid))
                  prog.tunerid = chan.tunerid
      
--- 289,293 ----
          for chan in guide.chan_list:
              if prog.channel_id == chan.id:
!                 _debug_('scheduleRecording: prog.channel_id="%s" chan.id="%s" 
chan.tunerid="%s"' % (prog.channel_id, chan.id, chan.tunerid))
                  prog.tunerid = chan.tunerid
      
***************
*** 336,340 ****
          global guide
  
!         if DEBUG: log.debug('findProg: %s, %s' % (chan, start))
  
          if not chan or not start:
--- 337,341 ----
          global guide
  
!         _debug_('findProg: %s, %s' % (chan, start))
  
          if not chan or not start:
***************
*** 345,352 ****
          for ch in guide.chan_list:
              if chan == ch.id:
!                 if DEBUG: log.debug('CHANNEL MATCH')
                  for prog in ch.programs:
                      if start == '%s' % prog.start:
!                         if DEBUG: log.debug('PROGRAM MATCH')
                          return (TRUE, prog.decode())
  
--- 346,353 ----
          for ch in guide.chan_list:
              if chan == ch.id:
!                 _debug_('CHANNEL MATCH')
                  for prog in ch.programs:
                      if start == '%s' % prog.start:
!                         _debug_('PROGRAM MATCH')
                          return (TRUE, prog.decode())
  
***************
*** 357,366 ****
          global guide
  
!         if DEBUG: log.debug('findMatches: %s' % find)
      
          matches = []
  
          if not find and not movies_only:
!             if DEBUG: log.debug('nothing to find')
              return (FALSE, 'no search string')
  
--- 358,367 ----
          global guide
  
!         _debug_('findMatches: %s' % find)
      
          matches = []
  
          if not find and not movies_only:
!             _debug_('nothing to find')
              return (FALSE, 'no search string')
  
***************
*** 377,382 ****
                  if not find or regex.match(prog.title) or regex.match(prog.desc) \
                     or regex.match(prog.sub_title):
!                     if DEBUG:
!                         log.debug('PROGRAM MATCH: %s' % prog.decode())
                      if movies_only:
                          if hasattr(prog, 'date') and prog.date:
--- 378,382 ----
                  if not find or regex.match(prog.title) or regex.match(prog.desc) \
                     or regex.match(prog.sub_title):
!                     _debug_('PROGRAM MATCH: %s' % prog.decode())
                      if movies_only:
                          if hasattr(prog, 'date') and prog.date:
***************
*** 387,392 ****
                          matches.append(prog.decode())
  
!         if DEBUG:
!             log.debug('return: %s' % str(matches))
  
          if matches:
--- 387,391 ----
                          matches.append(prog.decode())
  
!         _debug_('return: %s' % str(matches))
  
          if matches:
***************
*** 404,408 ****
          
      def checkToRecord(self):
!         if DEBUG: log.debug('in checkToRecord')
          rec_cmd = None
          rec_prog = None
--- 403,407 ----
          
      def checkToRecord(self):
!         _debug_('in checkToRecord')
          rec_cmd = None
          rec_prog = None
***************
*** 426,430 ****
          now = time.time()
          for prog in progs.values():
!             if DEBUG: log.debug('checkToRecord: progloop = %s' % prog)
  
              try:
--- 425,429 ----
          now = time.time()
          for prog in progs.values():
!             _debug_('checkToRecord: progloop = %s' % String(prog))
  
              try:
***************
*** 453,457 ****
                          plugin.getbyname('RECORD').Stop()
                          time.sleep(5)
!                         log.debug('CALLED RECORD STOP 1')
                      else:
                          # at this moment we must be in the pre-record padding
--- 452,456 ----
                          plugin.getbyname('RECORD').Stop()
                          time.sleep(5)
!                         _debug_('CALLED RECORD STOP 1')
                      else:
                          # at this moment we must be in the pre-record padding
***************
*** 469,473 ****
                                  plugin.getbyname('RECORD').Stop()
                                  time.sleep(5)
!                                 log.debug('CALLED RECORD STOP 2')
                              else: 
                                  delay_recording = TRUE
--- 468,472 ----
                                  plugin.getbyname('RECORD').Stop()
                                  time.sleep(5)
!                                 _debug_('CALLED RECORD STOP 2')
                              else: 
                                  delay_recording = TRUE
***************
*** 477,483 ****
                          
                  if delay_recording:
!                     if DEBUG: log.debug('delaying: %s' % prog)
                  else:
!                     if DEBUG: log.debug('going to record: %s' % prog)
                      prog.isRecording = TRUE
                      prog.rec_duration = duration
--- 476,482 ----
                          
                  if delay_recording:
!                     _debug_('delaying: %s' % prog)
                  else:
!                     _debug_('going to record: %s' % prog)
                      prog.isRecording = TRUE
                      prog.rec_duration = duration
***************
*** 489,493 ****
              # If the program is over remove the entry.
              if ( prog.stop + config.TV_RECORD_PADDING) < now:
!                 if DEBUG: log.debug('found a program to clean')
                  cleaned = TRUE
                  del progs[tv_util.getKey(prog)]
--- 488,492 ----
              # If the program is over remove the entry.
              if ( prog.stop + config.TV_RECORD_PADDING) < now:
!                 _debug_('found a program to clean')
                  cleaned = TRUE
                  del progs[tv_util.getKey(prog)]
***************
*** 577,581 ****
          newprio = oldprio + mod
      
!         if DEBUG: log.debug('ap: mod=%s\n' % mod)
         
          sr = self.getScheduledRecordings()
--- 576,580 ----
          newprio = oldprio + mod
      
!         _debug_('ap: mod=%s\n' % mod)
         
          sr = self.getScheduledRecordings()
***************
*** 587,609 ****
      
              if fav.name == me.name:
!                 if DEBUG: log.debug('MATCH')
                  fav.priority = newprio
!                 log.debug('moved prio of %s: %s => %s\n' % (fav.name, oldprio, 
newprio))
                  continue
              if mod < 0:
                  if fav.priority < newprio or fav.priority > oldprio:
!                     if DEBUG:
!                         log.debug('fp: %s, old: %s, new: %s\n' % (fav.priority, 
oldprio, newprio))
!                         log.debug('skipping: %s\n' % fav.name)
                      continue
                  fav.priority = fav.priority + 1
!                 if DEBUG: log.debug('moved prio of %s: %s => %s\n' % (fav.name, 
fav.priority-1, fav.priority))
                  
              if mod > 0:
                  if fav.priority > newprio or fav.priority < oldprio:
!                     if DEBUG: log.debug('skipping: %s\n' % fav.name)
                      continue
                  fav.priority = fav.priority - 1
!                 if DEBUG: log.debug('moved prio of %s: %s => %s\n' % (fav.name, 
fav.priority+1, fav.priority))
      
          sr.setFavoritesList(favs)
--- 586,607 ----
      
              if fav.name == me.name:
!                 _debug_('MATCH')
                  fav.priority = newprio
!                 _debug_('moved prio of %s: %s => %s\n' % (fav.name, oldprio, 
newprio))
                  continue
              if mod < 0:
                  if fav.priority < newprio or fav.priority > oldprio:
!                     _debug_('fp: %s, old: %s, new: %s\n' % (fav.priority, oldprio, 
newprio))
!                     _debug_('skipping: %s\n' % fav.name)
                      continue
                  fav.priority = fav.priority + 1
!                 _debug_('moved prio of %s: %s => %s\n' % (fav.name, fav.priority-1, 
fav.priority))
                  
              if mod > 0:
                  if fav.priority > newprio or fav.priority < oldprio:
!                     _debug_('skipping: %s\n' % fav.name)
                      continue
                  fav.priority = fav.priority - 1
!                 _debug_('moved prio of %s: %s => %s\n' % (fav.name, fav.priority+1, 
fav.priority))
      
          sr.setFavoritesList(favs)
***************
*** 894,898 ****
      def startMinuteCheck(self):
          next_minute = (int(time.time()/60) * 60 + 60) - int(time.time())
!         if DEBUG: log.debug('top of the minute in %s seconds' % next_minute)
          reactor.callLater(next_minute, self.minuteCheck)
  
--- 892,896 ----
      def startMinuteCheck(self):
          next_minute = (int(time.time()/60) * 60 + 60) - int(time.time())
!         _debug_('top of the minute in %s seconds' % next_minute)
          reactor.callLater(next_minute, self.minuteCheck)
  



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to