Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29729
Modified Files:
mcomm.py
Log Message:
add functions to send an event and register to one.
Index: mcomm.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/mcomm.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** mcomm.py 19 Dec 2004 16:40:25 -0000 1.10
--- mcomm.py 20 Dec 2004 21:26:59 -0000 1.11
***************
*** 341,344 ****
--- 341,357 ----
+ def register_event(mcommand, function):
+ """
+ Register a callback function for the given mcommand.
+ """
+ return instance().register_event(mcommand, function)
+
+
+ def send_event(addr, cmdname, cmdargs):
+ """
+ Send an event to the given addr.
+ """
+ return instance().send_event(addr, cmdname, cmdargs)
+
class Instance(mbus.Guides):
***************
*** 355,358 ****
--- 368,372 ----
# init the mbus interface
+ print '************ create mbus entity', addr
mbus.Guides.__init__( self, addr )
***************
*** 409,412 ****
--- 423,442 ----
+ def register_event(self, mcommand, function):
+ """
+ Register a callback function for the given mcommand.
+ """
+ return self.addCallback('home-theatre.' + mcommand, function)
+
+
+ def send_event(self, addr, cmdname, cmdargs):
+ """
+ Send an event to the given addr.
+ """
+ self.send(addr, 'home-theatre.' + cmdname, _build_args(cmdargs))
+ # self.sendReliable(addr, 'home-theatre.' + cmdname,
+ # _build_args(cmdargs))
+
+
def new_entity(self, maddr):
"""
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog