Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24892/src/plugins

Modified Files:
        mbus.py 
Log Message:
move idle time handling to mbus plugin

Index: mbus.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/mbus.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** mbus.py     16 Jul 2005 10:07:25 -0000      1.3
--- mbus.py     16 Jul 2005 13:38:34 -0000      1.4
***************
*** 1,2 ****
--- 1,4 ----
+ from kaa.notifier import EventHandler, Timer
+ 
  import mcomm
  import plugin
***************
*** 8,11 ****
--- 10,26 ----
          plugin.Plugin.__init__(self)
          mcomm.RPCServer.__init__(self)
+         self.__events = EventHandler(self.eventhandler)
+         self.__timer = Timer(self.update_idle_time)
+         self.idle_time = 0
+         
+     def plugin_activate(self):
+         """
+         Execute on activation of the plugin.
+         """
+         plugin.Plugin.plugin_activate(self)
+         self.idle_time = 0
+         self.__events.register()
+         self.__timer.start(60000)
+         
          
      def __rpc_play__(self, addr, val):
***************
*** 27,28 ****
--- 42,64 ----
          event.STOP.post()
          return mcomm.RPCReturn()
+ 
+ 
+     def __rpc_status__(self, addr, val):
+         """
+         Send status on rpc status request.
+         """
+         if not application.eventhandler.is_menu():
+             self.idle_time = 0
+         status = { 'idle': self.idle_time }
+         return mcomm.RPCReturn(status)
+ 
+ 
+     def eventhandler(self, event):
+         # each event resets the idle time
+         self.idle_time = 0
+         return False
+ 
+ 
+     def update_idle_time(self):
+         self.idle_time += 1
+         return True



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to