Author: duncan
Date: Sun Oct 28 15:25:54 2007
New Revision: 10042

Log:
Fixed generic games, passing the file to the command line
Added debug statements for the calls


Modified:
   branches/rel-1-7/freevo/src/games/__init__.py
   branches/rel-1-7/freevo/src/games/game.py
   branches/rel-1-7/freevo/src/games/genericitem.py
   branches/rel-1/freevo/src/games/__init__.py
   branches/rel-1/freevo/src/games/game.py
   branches/rel-1/freevo/src/games/genericitem.py

Modified: branches/rel-1-7/freevo/src/games/__init__.py
==============================================================================
--- branches/rel-1-7/freevo/src/games/__init__.py       (original)
+++ branches/rel-1-7/freevo/src/games/__init__.py       Sun Oct 28 15:25:54 2007
@@ -51,6 +51,7 @@
     """
 
     def __init__(self):
+        _debug_('PluginInterface.__init__()', 2)
         plugin.MimetypePlugin.__init__(self)
         self.display_type = [ 'games' ]
 
@@ -62,6 +63,7 @@
         """
         return the list of suffixes this class handles
         """
+        _debug_('suffix()', 2)
         return []
 
 
@@ -69,6 +71,7 @@
         """
         return a list of items based on the files
         """
+        _debug_('get(parent=%r, files=%r)' % (parent, files), 2)
         items = []
 
         if not hasattr(parent, 'add_args') or type(parent.add_args) is not 
types.TupleType:
@@ -98,10 +101,12 @@
                     items += [ GenesisItem(file, cmd, args, imgpath, parent) ]
                     files.remove(file)
             elif gtype == 'GENERIC':
+                _debug_('find_matches=%r files=%r suffixlist=%r' % \
+                    (util.find_matches(files, suffixlist), files, suffixlist), 
2)
                 for file in util.find_matches(files, suffixlist):
                     items += [ GenericItem(file, cmd, args, imgpath, parent) ]
                     files.remove(file)
         except UnboundLocalError:
-            print 'Zip file \"%s\" may be corrupt' % file
+            _debug_('Zip file \"%s\" may be corrupt' % file, DWARNING)
 
         return items

Modified: branches/rel-1-7/freevo/src/games/game.py
==============================================================================
--- branches/rel-1-7/freevo/src/games/game.py   (original)
+++ branches/rel-1-7/freevo/src/games/game.py   Sun Oct 28 15:25:54 2007
@@ -54,6 +54,7 @@
 _singleton = None
 
 def get_singleton():
+    _debug_('get_singleton()', 2)
     global _singleton
 
     # One-time init
@@ -65,10 +66,12 @@
 class Game:
 
     def __init__(self):
+        _debug_('Game.__init__()', 2)
         self.mode = None
         self.app_mode = 'games'
 
     def play(self, item, menuw):
+        _debug_('play(item=%r, menuw=%r)' % (item, menuw), 2)
 
         self.item = item
         self.filename = item.filename
@@ -102,6 +105,7 @@
 
 
     def stop(self):
+        _debug_('stop()', 2)
         self.app.stop()
         rc.app(None)
         rc.resume()
@@ -113,10 +117,12 @@
 
 
     def eventhandler(self, event, menuw=None):
+        _debug_('eventhandler(event%r, menuw=%r)' % (event, menuw), 2)
         return self.item.eventhandler(event, self.menuw)
 
 
 # ======================================================================
 class GameApp(childapp.ChildApp2):
     def stop_event(self):
+        _debug_('stop_event()', 2)
         return em.STOP

Modified: branches/rel-1-7/freevo/src/games/genericitem.py
==============================================================================
--- branches/rel-1-7/freevo/src/games/genericitem.py    (original)
+++ branches/rel-1-7/freevo/src/games/genericitem.py    Sun Oct 28 15:25:54 2007
@@ -49,7 +49,9 @@
 
 
 class GenericItem(Item):
-    def __init__(self, file, cmd = None, args = None, imgpath = None, parent = 
None):
+    def __init__(self, file, cmd=None, args=None, imgpath=None, parent=None):
+        _debug_('GenericItem.__init__(file=%r, cmd=%r, args=%r, imgpath=%r, 
parent=%r)' % \
+            (file, cmd, args, imgpath, parent), 2)
         Item.__init__(self, parent)
         self.type  = 'generic'            # fix value
         self.set_url(file, info=True)
@@ -68,7 +70,7 @@
 
         command = ['--prio=%s' % config.GAMES_NICE, cmd]
         command.extend(args.split())
-        command.append(file)
+        #command.append(file)
 
         self.command = command
 
@@ -79,6 +81,7 @@
         """
         Returns the string how to sort this item
         """
+        _debug_('sort(mode=%r)' % (mode), 2)
         return self.name
 
 
@@ -87,10 +90,12 @@
 
 
     def actions(self):
+        _debug_('actions()', 2)
         return [ ( self.play, 'Play' ) ]
 
 
     def play(self, arg=None, menuw=None):
+        _debug_('play(arg=%r, menuw=%r)' % (arg, menuw), 2)
         self.parent.current_item = self
 
         if not self.menuw:
@@ -105,10 +110,12 @@
 
 
     def stop(self, menuw=None):
+        _debug_('stop(menuw=%r)' % (menuw), 2)
         self.game_player.stop()
 
 
     def eventhandler(self, event, menuw=None):
+        _debug_('eventhandler(event=%r, menuw=%r)' % (event, menuw), 2)
 
         if event == em.STOP:
             self.stop()

Modified: branches/rel-1/freevo/src/games/__init__.py
==============================================================================
--- branches/rel-1/freevo/src/games/__init__.py (original)
+++ branches/rel-1/freevo/src/games/__init__.py Sun Oct 28 15:25:54 2007
@@ -51,6 +51,7 @@
     """
 
     def __init__(self):
+        _debug_('PluginInterface.__init__()', 2)
         plugin.MimetypePlugin.__init__(self)
         self.display_type = [ 'games' ]
 
@@ -62,6 +63,7 @@
         """
         return the list of suffixes this class handles
         """
+        _debug_('suffix()', 2)
         return []
 
 
@@ -69,6 +71,7 @@
         """
         return a list of items based on the files
         """
+        _debug_('get(parent=%r, files=%r)' % (parent, files), 2)
         items = []
 
         if not hasattr(parent, 'add_args') or type(parent.add_args) is not 
types.TupleType:
@@ -98,10 +101,12 @@
                     items += [ GenesisItem(file, cmd, args, imgpath, parent) ]
                     files.remove(file)
             elif gtype == 'GENERIC':
+                _debug_('find_matches=%r files=%r suffixlist=%r' % \
+                    (util.find_matches(files, suffixlist), files, suffixlist), 
2)
                 for file in util.find_matches(files, suffixlist):
                     items += [ GenericItem(file, cmd, args, imgpath, parent) ]
                     files.remove(file)
         except UnboundLocalError:
-            print 'Zip file \"%s\" may be corrupt' % file
+            _debug_('Zip file \"%s\" may be corrupt' % file, DWARNING)
 
         return items

Modified: branches/rel-1/freevo/src/games/game.py
==============================================================================
--- branches/rel-1/freevo/src/games/game.py     (original)
+++ branches/rel-1/freevo/src/games/game.py     Sun Oct 28 15:25:54 2007
@@ -54,6 +54,7 @@
 _singleton = None
 
 def get_singleton():
+    _debug_('get_singleton()', 2)
     global _singleton
 
     # One-time init
@@ -65,10 +66,12 @@
 class Game:
 
     def __init__(self):
+        _debug_('Game.__init__()', 2)
         self.mode = None
         self.app_mode = 'games'
 
     def play(self, item, menuw):
+        _debug_('play(item=%r, menuw=%r)' % (item, menuw), 2)
 
         self.item = item
         self.filename = item.filename
@@ -102,6 +105,7 @@
 
 
     def stop(self):
+        _debug_('stop()', 2)
         self.app.stop()
         rc.app(None)
         rc.resume()
@@ -113,10 +117,12 @@
 
 
     def eventhandler(self, event, menuw=None):
+        _debug_('eventhandler(event%r, menuw=%r)' % (event, menuw), 2)
         return self.item.eventhandler(event, self.menuw)
 
 
 # ======================================================================
 class GameApp(childapp.ChildApp2):
     def stop_event(self):
+        _debug_('stop_event()', 2)
         return em.STOP

Modified: branches/rel-1/freevo/src/games/genericitem.py
==============================================================================
--- branches/rel-1/freevo/src/games/genericitem.py      (original)
+++ branches/rel-1/freevo/src/games/genericitem.py      Sun Oct 28 15:25:54 2007
@@ -49,7 +49,9 @@
 
 
 class GenericItem(Item):
-    def __init__(self, file, cmd = None, args = None, imgpath = None, parent = 
None):
+    def __init__(self, file, cmd=None, args=None, imgpath=None, parent=None):
+        _debug_('GenericItem.__init__(file=%r, cmd=%r, args=%r, imgpath=%r, 
parent=%r)' % \
+            (file, cmd, args, imgpath, parent), 2)
         Item.__init__(self, parent)
         self.type  = 'generic'            # fix value
         self.set_url(file, info=True)
@@ -68,7 +70,7 @@
 
         command = ['--prio=%s' % config.GAMES_NICE, cmd]
         command.extend(args.split())
-        command.append(file)
+        #command.append(file)
 
         self.command = command
 
@@ -79,6 +81,7 @@
         """
         Returns the string how to sort this item
         """
+        _debug_('sort(mode=%r)' % (mode), 2)
         return self.name
 
 
@@ -87,10 +90,12 @@
 
 
     def actions(self):
+        _debug_('actions()', 2)
         return [ ( self.play, 'Play' ) ]
 
 
     def play(self, arg=None, menuw=None):
+        _debug_('play(arg=%r, menuw=%r)' % (arg, menuw), 2)
         self.parent.current_item = self
 
         if not self.menuw:
@@ -105,10 +110,12 @@
 
 
     def stop(self, menuw=None):
+        _debug_('stop(menuw=%r)' % (menuw), 2)
         self.game_player.stop()
 
 
     def eventhandler(self, event, menuw=None):
+        _debug_('eventhandler(event=%r, menuw=%r)' % (event, menuw), 2)
 
         if event == em.STOP:
             self.stop()

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to