On Wed, Jan 31, 2007 at 10:53:28PM +0100, Gorka Olaizola wrote:
> 
> Is there a way of debugging python with a debugger?
> 
Yes, there is :-)

python -m pdb /usr/bin/freevo

I have found that the responsible for the duplicate event is the line
285 of main.py that calls   app.eventhandler(event).

app in this case is the Main menu widget whose code is in menu.py.

The eventhandler of the file menu.py in the line 451 sets
self.eventhandler_plugins to call the eventhandler of the daemon and
mainmenu plugins in the bucle of line 742.
When the event is not processed in the menu eventhandler it gets passed
to the plugins.

I'm not sure why the MenuWidget has to propagate to the plugins all the
events that it does not handle but I suppose there is no bug because the
code is very old (from the Revision 2285[1])

I think that in the eventhandler of my plugin I have to process the
events that do not need a valid menuw separated from the ones that need data
from menuw. This way I think I won't process the duplicated events.

I'm thinking in something simple like this:

        if menuw and isinstance(menuw, menu.MenuWidget):
            if event == em.MENU_PROCESS_END:
              [...]
            elif event == em.Event('FREEVUSED_ITEM_STATUS'):
              [...]

        else:

            if event == em.VIDEO_START:
              [...]

            elif event == em.VIDEO_END:
              [...]

            elif event == em.PLAY_START:
              [...]

            elif event == em.PLAY_END:
              [...]

            elif event == em.STOP:
              [...]


[1] 
http://tvcentric.com/viewvc/freevo/branches/rel-1/freevo/src/menu.py?revision=2285&view=markup

-- 

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to