changeset 535:790be337cc41

bridge: fixed D-Bus warning in frontend side of bridge
author Goffi <goffi@goffi.org>
date Thu, 01 Nov 2012 19:52:59 +0100
parents 07f369ed3988
children a31abb97310d
files frontends/src/bridge/DBus.py src/bridge/bridge_constructor/dbus_frontend_template.py src/plugins/plugin_misc_text_commands.py
diffstat 3 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/bridge/DBus.py	Tue Oct 30 00:54:42 2012 +0100
+++ b/frontends/src/bridge/DBus.py	Thu Nov 01 19:52:59 2012 +0100
@@ -20,9 +20,12 @@
 """
 
 from bridge_frontend import BridgeFrontend
-import dbus, dbus.glib
+import dbus
 from logging import debug, error
 
+from dbus.mainloop.glib import DBusGMainLoop
+DBusGMainLoop(set_as_default=True)
+
 const_INT_PREFIX = "org.goffi.SAT"  #Interface prefix
 const_ERROR_PREFIX = const_INT_PREFIX+".error"
 const_OBJ_PATH = '/org/goffi/SAT/bridge'
--- a/src/bridge/bridge_constructor/dbus_frontend_template.py	Tue Oct 30 00:54:42 2012 +0100
+++ b/src/bridge/bridge_constructor/dbus_frontend_template.py	Thu Nov 01 19:52:59 2012 +0100
@@ -20,9 +20,12 @@
 """
 
 from bridge_frontend import BridgeFrontend
-import dbus, dbus.glib
+import dbus
 from logging import debug, error
 
+from dbus.mainloop.glib import DBusGMainLoop
+DBusGMainLoop(set_as_default=True)
+
 const_INT_PREFIX = "org.goffi.SAT"  #Interface prefix
 const_ERROR_PREFIX = const_INT_PREFIX+".error"
 const_OBJ_PATH = '/org/goffi/SAT/bridge'
--- a/src/plugins/plugin_misc_text_commands.py	Tue Oct 30 00:54:42 2012 +0100
+++ b/src/plugins/plugin_misc_text_commands.py	Thu Nov 01 19:52:59 2012 +0100
@@ -161,6 +161,9 @@
 
     def cmd_parrot(self, mess_data, profile):
         """activate Parrot mode between 2 entities, in both directions."""
+        #TODO: these commands must not be hardcoded, an interface should be made
+        #      to allow plugins to register simple commands like this.
+        
         debug("Catched parrot command")
        
         try: