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

Modified Files:
        server.py 
Log Message:
-Add some TODO comments.
-Remove .decode() call on prog objects as it isn't there anymore.  It is also possible 
that we must access the prog object in a different manner now.


Index: server.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/record/server.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** server.py   8 Aug 2004 19:03:18 -0000       1.2
--- server.py   9 Aug 2004 12:11:41 -0000       1.3
***************
*** 8,11 ****
--- 8,15 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.3  2004/08/09 12:11:41  rshortt
+ # -Add some TODO comments.
+ # -Remove .decode() call on prog objects as it isn't there anymore.  It is also 
possible that we must access the prog object in a different manner now.
+ #
  # Revision 1.2  2004/08/08 19:03:18  rshortt
  # -Integrate some things into the Twisted main loop:
***************
*** 171,176 ****
              return (FALSE, 'cannot record it if it is over')
              
-         self.updateGuide()
-     
          for chan in guide.chan_list:
              if prog.channel_id == chan.id:
--- 175,178 ----
***************
*** 244,249 ****
              return (FALSE, 'no chan or no start')
  
-         self.updateGuide()
- 
          for ch in guide.chan_list:
              if chan == ch.id:
--- 246,249 ----
***************
*** 269,274 ****
              return (FALSE, 'no search string')
  
-         self.updateGuide()
- 
          pattern = '.*' + find + '\ *'
          regex = re.compile(pattern, re.IGNORECASE)
--- 269,272 ----
***************
*** 284,295 ****
                          # We can do better here than just look for the MPAA 
                          # rating.  Suggestions are welcome.
!                         if 'MPAA' in prog.decode().getattr('ratings').keys():
!                             matches.append(prog.decode())
!                             _debug_('PROGRAM MATCH: %s' % prog.decode())
                      else:
                          # We should never get here if not find and not 
                          # movies_only.
!                         matches.append(prog.decode())
!                         _debug_('PROGRAM MATCH: %s' % prog.decode())
                  if len(matches) >= max_results:
                      break
--- 282,293 ----
                          # We can do better here than just look for the MPAA 
                          # rating.  Suggestions are welcome.
!                         if 'MPAA' in prog.getattr('ratings').keys():
!                             matches.append(prog)
!                             _debug_('PROGRAM MATCH: %s' % prog)
                      else:
                          # We should never get here if not find and not 
                          # movies_only.
!                         matches.append(prog)
!                         _debug_('PROGRAM MATCH: %s' % prog)
                  if len(matches) >= max_results:
                      break
***************
*** 303,313 ****
  
  
-     def updateGuide(self):
-         global guide
- 
-         # XXX TODO: only do this if the guide has changed?
-         guide = tv_util.get_guide()
- 
-         
      def checkToRecord(self):
          _debug_('in checkToRecord')
--- 301,304 ----
***************
*** 358,362 ****
--- 349,357 ----
                                           tv_util.getKey(currently_recording))
                          eh.post(Event('STOP_RECORDING', arg=prog))
+ 
+                         # XXX:  Don't sleep (block) if we don't have to.
+                         #       Keep an eye on this.
                          # time.sleep(5)
+ 
                          _debug_('CALLED RECORD STOP 1')
                      else:
***************
*** 578,583 ****
          favs[fav.name] = fav
  
-         self.updateGuide()
-     
          for ch in guide.chan_list:
              for prog in ch.programs:
--- 573,576 ----
***************
*** 596,601 ****
          guide = tv_util.get_guide()
      
-         self.updateGuide()
-     
          # First get the timeframe of the guide.
          last = 0
--- 589,592 ----
***************
*** 862,865 ****
--- 853,864 ----
          _debug_('handling event %s' % str(event))
  
+         #  XXX:  Here we're ripping off code from the 'freevo main' event loop.
+         #        I think eventhandler.handle() is made for freevo main and we
+         #        need something different (like below) for recordserver.
+         #        Freevo main plugins register callbacks that get called from
+         #        its MainLoop.  Again, recordserver is different and the old
+         #        style of poll()/plugin.eventhandler() works well here.
+         #        Comments welcome.
+ 
          if eh.eventhandler_plugins == None:
              import plugin
***************
*** 878,884 ****
--- 877,890 ----
  
          if event == OS_EVENT_POPEN2:
+             # XXX TODO:  Test the Twisted process handling.
+ 
              print 'popen %s' % event.arg[1]
              event.arg[0].child = util.popen3.Popen3(event.arg[1])
  
+ 
+         # XXX TODO:  Change these for/sleep loops to be more non-blocking.
+         #            We could post another event or use reactor.callLater()
+         #            to call waitpid in a further itteration of the mail loop.
+ 
          elif event == OS_EVENT_WAITPID:
              pid = event.arg[0]



-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to