Re: [Freevo-devel] Problem with events in a DaemonPlugin

2007-02-01 Thread Gorka Olaizola
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

-- 


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


Re: [Freevo-devel] Problem with events in a DaemonPlugin

2007-01-31 Thread Gorka Olaizola
On Wed, Jan 31, 2007 at 08:27:56PM +0100, Duncan Webb wrote:
> > 
> > freevused.py (301): Saw PLUGIN_EVENT IDENTIFY_MEDIA None
> > freevoscreensaver.py (102): Saver saw PLUGIN_EVENT IDENTIFY_MEDIA
> > mplayer_aspectratio.py (134): Saw PLUGIN_EVENT IDENTIFY_MEDIA
> > 
> > freevused.py (301): Saw PLUGIN_EVENT IDENTIFY_MEDIA None, top=0 left=0
> > freevoscreensaver.py (102): Saver saw PLUGIN_EVENT IDENTIFY_MEDIA
> > mplayer_aspectratio.py (134): Saw PLUGIN_EVENT IDENTIFY_MEDIA
> 
> You always get to PLUGIN_EVENT IDENTIFY_MEDIA events, no idea why, so
> you shouldn't worry about this one
>
The problem is the duplication of the event and that in the first line
it seems that there is no menuwidget and in the second there is a
menuwidget.

It seems that not all events get duplicated. In the menu the MENU_LEFT,
MENU_RIGHT, etc... do not get duplicated but the BUTTON event,
MENU_PROCESS_EVENT or my custom FREEVUSED_* get duplicated.

It seems that the events of the current context don't get duplicated
while all the others get duplicated.

In the event queue there is only one event at a time so I don't know
what is causing this behaviour. Maybe in the eventhandler function of
the menu.

Is there a way of debugging python with a debugger?

-- 


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


Re: [Freevo-devel] Problem with events in a DaemonPlugin

2007-01-31 Thread Duncan Webb
Gorka Olaizola wrote:
> Does anyone recognize the names top=0 left=0?
> 
> They get printed in the duplicated event if I do
> 
>   print 'Saw %s %s' % (event, menuw)
> 
> from the freevused eventhandler(self, event, menuw=None) function
> 
> I think is quite strange and I think is not my fault because the screen
> saver plugin is getting duplicated events too so it could be my
> configuration or you are getting duplicated events too.
> 
> The log I get is something like this:
> 
> freevused.py (301): Saw PLUGIN_EVENT IDENTIFY_MEDIA None
> freevoscreensaver.py (102): Saver saw PLUGIN_EVENT IDENTIFY_MEDIA
> mplayer_aspectratio.py (134): Saw PLUGIN_EVENT IDENTIFY_MEDIA
> 
> freevused.py (301): Saw PLUGIN_EVENT IDENTIFY_MEDIA None, top=0 left=0
> freevoscreensaver.py (102): Saver saw PLUGIN_EVENT IDENTIFY_MEDIA
> mplayer_aspectratio.py (134): Saw PLUGIN_EVENT IDENTIFY_MEDIA

You always get to PLUGIN_EVENT IDENTIFY_MEDIA events, no idea why, so
you shouldn't worry about this one
> 
> 
> freevused.py (301): Saw MENU_PROCESS_END None
> freevoscreensaver.py (102): Saver saw MENU_PROCESS_END
> mplayer_aspectratio.py (134): Saw MENU_PROCESS_END
> 
> freevused.py (301): Saw MENU_PROCESS_END None, top=0 left=0
> freevoscreensaver.py (102): Saver saw MENU_PROCESS_END
> mplayer_aspectratio.py (134): Saw MENU_PROCESS_END

These are from different sources but the looks of them otherwise you
would see top=0 left=0 on both of the messages. It is possible that you
are generating both events.

Duncan


-
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


Re: [Freevo-devel] Problem with events in a DaemonPlugin

2007-01-31 Thread Gorka Olaizola
Does anyone recognize the names top=0 left=0?

They get printed in the duplicated event if I do

  print 'Saw %s %s' % (event, menuw)

from the freevused eventhandler(self, event, menuw=None) function

I think is quite strange and I think is not my fault because the screen
saver plugin is getting duplicated events too so it could be my
configuration or you are getting duplicated events too.

The log I get is something like this:

freevused.py (301): Saw PLUGIN_EVENT IDENTIFY_MEDIA None
freevoscreensaver.py (102): Saver saw PLUGIN_EVENT IDENTIFY_MEDIA
mplayer_aspectratio.py (134): Saw PLUGIN_EVENT IDENTIFY_MEDIA

freevused.py (301): Saw PLUGIN_EVENT IDENTIFY_MEDIA None, top=0 left=0
freevoscreensaver.py (102): Saver saw PLUGIN_EVENT IDENTIFY_MEDIA
mplayer_aspectratio.py (134): Saw PLUGIN_EVENT IDENTIFY_MEDIA


freevused.py (301): Saw MENU_PROCESS_END None
freevoscreensaver.py (102): Saver saw MENU_PROCESS_END
mplayer_aspectratio.py (134): Saw MENU_PROCESS_END

freevused.py (301): Saw MENU_PROCESS_END None, top=0 left=0
freevoscreensaver.py (102): Saver saw MENU_PROCESS_END
mplayer_aspectratio.py (134): Saw MENU_PROCESS_END

Thank you
-- 


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