Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4633
Modified Files:
childapp.py plugin.py
Log Message:
update to new callback handling in rc
Index: childapp.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/childapp.py,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** childapp.py 30 May 2004 18:27:53 -0000 1.54
--- childapp.py 31 May 2004 10:40:57 -0000 1.55
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.55 2004/05/31 10:40:57 dischi
+ # update to new callback handling in rc
+ #
# Revision 1.54 2004/05/30 18:27:53 dischi
# More event / main loop cleanup. rc.py has a changed interface now
***************
*** 322,326 ****
if self.logger:
self.logger.write(saved + lines[0]+'\n')
! rc.register(self.callback, saved + lines[0])
saved = ''
--- 325,329 ----
if self.logger:
self.logger.write(saved + lines[0]+'\n')
! rc.register(self.callback, False, 0, saved + lines[0])
saved = ''
***************
*** 334,338 ****
if self.logger:
self.logger.write(line+'\n')
! rc.register(self.callback, line)
else:
# Send all lines to the app
--- 337,341 ----
if self.logger:
self.logger.write(line+'\n')
! rc.register(self.callback, False, 0, line)
else:
# Send all lines to the app
***************
*** 340,344 ****
if self.logger:
self.logger.write(line+'\n')
! rc.register(self.callback, line)
--- 343,347 ----
if self.logger:
self.logger.write(line+'\n')
! rc.register(self.callback, False, 0, line)
***************
*** 350,354 ****
"""
def __init__(self, app, debugname=None, doeslogging=0, stop_osd=2):
! rc.register(self)
self.is_video = 0 # Be more explicit
--- 353,358 ----
"""
def __init__(self, app, debugname=None, doeslogging=0, stop_osd=2):
! rc.register(self.poll, True, 10)
! rc.register(self.stop, True, rc.SHUTDOWN)
self.is_video = 0 # Be more explicit
***************
*** 399,403 ****
stop the child
"""
! rc.unregister(self)
if cmd and self.isAlive():
--- 403,408 ----
stop the child
"""
! rc.unregister(self.poll)
! rc.unregister(self.stop)
if cmd and self.isAlive():
Index: plugin.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugin.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** plugin.py 29 May 2004 19:06:46 -0000 1.64
--- plugin.py 31 May 2004 10:40:57 -0000 1.65
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.65 2004/05/31 10:40:57 dischi
+ # update to new callback handling in rc
+ #
# Revision 1.64 2004/05/29 19:06:46 dischi
# register poll function to rc
***************
*** 92,95 ****
--- 95,99 ----
from event import Event
+ import rc
DEBUG = 0
***************
*** 198,202 ****
"""
def __init__(self):
- import rc
Plugin.__init__(self)
self.poll_counter = 0 # poll counter, don't change this
--- 202,205 ----
***************
*** 204,211 ****
self.poll_menu_only = True # poll only when menu is active
self.event_listener = False # process all events
- if hasattr(self, 'poll'):
- rc.register(self)
class MimetypePlugin(Plugin):
"""
--- 207,218 ----
self.poll_menu_only = True # poll only when menu is active
self.event_listener = False # process all events
+ def poll_wrapper(self):
+ if self.poll_menu_only and rc.app():
+ return
+ self.real_poll()
+
+
class MimetypePlugin(Plugin):
"""
***************
*** 569,572 ****
--- 576,581 ----
load the plugin and add it to the lists
"""
+ import rc
+
global __plugin_type_list__
global __named_plugins__
***************
*** 646,649 ****
--- 655,665 ----
if hasattr(p, type):
__add_to_ptl__('daemon_%s' % type, p)
+ if hasattr(p, 'poll'):
+ if p.poll_menu_only:
+ # replace poll with the poll wrapper to handle
+ # poll_menu_only
+ p.real_poll = p.poll
+ p.poll = p.poll_wrapper
+ rc.register(p.poll, True, p.poll_interval)
if isinstance(p, MainMenuPlugin):
***************
*** 658,661 ****
--- 674,681 ----
__add_to_ptl__('mimetype', p)
+ if hasattr(p, 'shutdown'):
+ # register shutdown handler
+ rc.register(p.shutdown, True, rc.SHUTDOWN)
+
if p.plugin_name:
__named_plugins__[p.plugin_name] = p
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog