Author: duncan
Date: Thu Dec 13 15:38:15 2007
New Revision: 10206

Log:
Cleaned up debug messages...


Modified:
   branches/rel-1/freevo/src/audio/plugins/mplayer.py
   branches/rel-1/freevo/src/audio/plugins/radio.py
   branches/rel-1/freevo/src/audio/plugins/radioplayer.py
   branches/rel-1/freevo/src/audio/plugins/xine.py
   branches/rel-1/freevo/src/menu.py

Modified: branches/rel-1/freevo/src/audio/plugins/mplayer.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/mplayer.py  (original)
+++ branches/rel-1/freevo/src/audio/plugins/mplayer.py  Thu Dec 13 15:38:15 2007
@@ -78,7 +78,7 @@
             _debug_('mode=%r' % (item.mode), 2)
             _debug_('mimetype=%r' % (item.mimetype), 2)
         except Exception, e:
-            print e
+            pass
         if item.url.startswith('radio://'):
             _debug_('%r unplayable' % (item.url))
             return 0

Modified: branches/rel-1/freevo/src/audio/plugins/radio.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/radio.py    (original)
+++ branches/rel-1/freevo/src/audio/plugins/radio.py    Thu Dec 13 15:38:15 2007
@@ -65,6 +65,7 @@
 
 
     def checktv(self):
+        """ Check if something is recording """
         self.tvlockfile = config.FREEVO_CACHEDIR + '/record.*'
         if len(glob.glob(self.tvlockfile)) > 0:
             return True
@@ -72,7 +73,7 @@
 
 
     def play(self, arg=None, menuw=None):
-        print self.station+" "+str(self.station_index)+" "+self.name
+        _debug_('station=%r station_index=%r name=%r' % (self.station, 
self.station_index, self.name))
         # self.parent.current_item = self
         self.elapsed = 0
 
@@ -80,7 +81,6 @@
             self.menuw = menuw
 
         if self.checktv():
-            #AlertBox(text=_('Cannot play - recording in progress')).show()
             AlertBox(text=_('Cannot play - recording in progress'), 
handler=self.confirm).show()
             return 'Cannot play with RadioPlayer - recording in progress'
 
@@ -103,7 +103,7 @@
         """
         Stop the current playing
         """
-        print 'RadioItem stop'
+        _debug_('stop')
         self.player.stop()
 
 

Modified: branches/rel-1/freevo/src/audio/plugins/radioplayer.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/radioplayer.py      (original)
+++ branches/rel-1/freevo/src/audio/plugins/radioplayer.py      Thu Dec 13 
15:38:15 2007
@@ -73,10 +73,9 @@
         """
         try:
             _debug_('url=%r' % (item.url), 2)
-            _debug_('mode=%r' % (item.mode), 2)
-            _debug_('mimetype=%r' % (item.mimetype), 2)
+            _debug_('item.__dict__=%r' % (item.__dict__))
         except Exception, e:
-            print e
+            _debug_('%s' % e)
         if item.url.startswith('radio://'):
             _debug_('%r good' % (item.url))
             return 2
@@ -94,7 +93,7 @@
         self.starttime = time.time()
 
         try:
-            print 'RadioPlayer.play() %s' % self.item.station
+            _debug_('play() %s' % self.item.station)
         except AttributeError:
             return 'Cannot play with RadioPlayer - no station'
 
@@ -110,11 +109,11 @@
 
         if config.RADIO_CMD.find('ivtv-radio') >= 0:
             # IVTV cards
-            print '%s -f %s &' % (config.RADIO_CMD, self.item.station)
+            _debug_('%s -f %s &' % (config.RADIO_CMD, self.item.station))
             os.system('%s -f %s &' % (config.RADIO_CMD, self.item.station))
         else:
             # BTTV cards
-
+            _debug_('%s' % (config.RADIO_CMD_START % self.item.station))
             os.system('%s' % (config.RADIO_CMD_START % self.item.station))
         thread.start_new_thread(self.__update_thread, ())
 
@@ -141,6 +140,7 @@
             os.system('killall -9 aplay')
         else:
             # BTTV cards
+            _debug_('%s' % (config.RADIO_CMD_STOP))
             os.system('%s' % config.RADIO_CMD_STOP)
 
         rc.post_event(PLAY_END)
@@ -157,6 +157,7 @@
         self.item.elapsed = int(time.time() - self.starttime)
         self.playerGUI.refresh()
 
+
     def eventhandler(self, event, menuw=None):
         """
         eventhandler for mplayer control. If an event is not bound in this
@@ -170,6 +171,7 @@
             # everything else: give event to the items eventhandler
             return self.item.eventhandler(event)
 
+
     def __update_thread(self):
         """
         OSD update thread

Modified: branches/rel-1/freevo/src/audio/plugins/xine.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/xine.py     (original)
+++ branches/rel-1/freevo/src/audio/plugins/xine.py     Thu Dec 13 15:38:15 2007
@@ -88,7 +88,7 @@
             _debug_('mode=%r' % (item.mode), 2)
             _debug_('mimetype=%r' % (item.mimetype), 2)
         except Exception, e:
-            print e
+            pass
         if item.url.startswith('radio://'):
             _debug_('%r unplayable' % (item.url))
             return 0

Modified: branches/rel-1/freevo/src/menu.py
==============================================================================
--- branches/rel-1/freevo/src/menu.py   (original)
+++ branches/rel-1/freevo/src/menu.py   Thu Dec 13 15:38:15 2007
@@ -47,7 +47,7 @@
     """
     Default item for the menu. It includes one action
     """
-    def __init__( self, name, action=None, arg=None, type=None, image=None,
+    def __init__(self, name, action=None, arg=None, type=None, image=None,
                   icon=None, parent=None, skin_type=None):
         Item.__init__(self, parent, skin_type = skin_type)
         if name:
@@ -81,14 +81,14 @@
         """
         return the default action
         """
-        return [ ( self.select, self.name, 'MENU_SUBMENU' ) ]
+        return [ (self.select, self.name, 'MENU_SUBMENU') ]
 
 
     def select(self, arg=None, menuw=None):
         """
         call the default acion
         """
-        if self.function and not isinstance(self.function, list):
+        if self.function and callable(self.function):
             self.function(arg=self.arg, menuw=menuw)
 
 
@@ -503,7 +503,7 @@
             return
 
         if not self.menu_items:
-            if event in ( MENU_SELECT, MENU_SUBMENU, MENU_PLAY_ITEM):
+            if event in (MENU_SELECT, MENU_SUBMENU, MENU_PLAY_ITEM):
                 self.back_one_menu()
                 return
             menu = self.menustack[-2]
@@ -704,7 +704,7 @@
                 print 'No action.. '
                 AlertBox(text=_('No action defined for this choice!')).show()
             else:
-                action( arg=arg, menuw=self )
+                action(arg=arg, menuw=self)
             return
 
 
@@ -747,11 +747,9 @@
                         arg    = action.arg
                     else:
                         action = action[0]
-                    action( arg=arg, menuw=self )
+                    action(arg=arg, menuw=self)
             return
 
-
-
         elif event == MENU_CALL_ITEM_ACTION:
             _debug_('calling action %s' % event.arg)
 

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to