Author: dmeyer
Date: Sat Jan 13 19:42:17 2007
New Revision: 8974
Modified:
trunk/core/src/ipc/mbus_wrapper.py
Log:
exit on mbus.shutdown
Modified: trunk/core/src/ipc/mbus_wrapper.py
==============================================================================
--- trunk/core/src/ipc/mbus_wrapper.py (original)
+++ trunk/core/src/ipc/mbus_wrapper.py Sat Jan 13 19:42:17 2007
@@ -202,7 +202,14 @@
def matches(self, addr):
return mbus.isAddressedTo(addr, self.addr)
+ def shutdown(self):
+ # FIXME: make this mbus.quit
+ self.send('mbus.shutdown')
+ def __repr__(self):
+ return '<Mbus.RemoteEntity %s' % self.addr
+
+
class Event(list):
def __init__(self, source, event):
list.__init__(self, _fromMType(event.args))
@@ -370,8 +377,18 @@
# connect mbus.register rpc
self.connect_rpc(self._register_request, 'mbus.register',
add_source=True)
+ # handle mbus.shutdown. FIXME: It is not mbus.quit because pymbus eats
+ # that event and we can't react on it.
+ self.events['mbus.shutdown'].connect(self._shutdown)
+
+ def _shutdown(self, event):
+ """
+ Shutdown on mbus.shutdown message.
+ """
+ sys.exit(0)
+
def get_entities(self):
"""
Return a list of all known entities.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog