diff src/bridge/DBus.py @ 272:1d2e0dfe7114

bridge: core & frontend sides of bridge are now generated
author Goffi <goffi@goffi.org>
date Mon, 24 Jan 2011 22:05:04 +0100
parents bdcd535e179e
children c1ad04586edf
line wrap: on
line diff
--- a/src/bridge/DBus.py	Mon Jan 24 21:48:09 2011 +0100
+++ b/src/bridge/DBus.py	Mon Jan 24 22:05:04 2011 +0100
@@ -24,7 +24,7 @@
 import dbus
 import dbus.service
 import dbus.mainloop.glib
-from logging import debug, info, error
+from logging import debug, info
 
 const_INT_PREFIX = "org.goffi.SAT"  #Interface prefix
 const_COMM_SUFFIX = ".communication"
@@ -45,72 +45,72 @@
     @dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX,
                          signature='ssa{ss}')
     def actionResult(self, answer_type, id, data):
-        pass
+        debug ("actionResult")
 
     @dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX,
                          signature='ssa{sa{ss}}')
     def actionResultExt(self, answer_type, id, data):
-        pass
+        debug ("actionResultExt")
 
     @dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX,
                          signature='ssa{ss}')
     def askConfirmation(self, conf_type, id, data):
-        pass
+        debug ("askConfirmation")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='s')
     def connected(self, profile):
-        pass
+        debug ("connected")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='ss')
     def connection_error(self, error_type, profile):
-        pass
+        debug ("connection_error")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='ss')
     def contactDeleted(self, entity, profile):
-        pass
+        debug ("contactDeleted")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='s')
     def disconnected(self, profile):
-        pass
+        debug ("disconnected")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='ssss')
     def newAlert(self, message, title, alert_type, profile):
-        pass
+        debug ("newAlert")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='sa{ss}ass')
     def newContact(self, contact, attributes, groups, profile):
-        pass
+        debug ("newContact")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='sssss')
     def newMessage(self, from_jid, message, mess_type, to_jid, profile):
-        pass
+        debug ("newMessage")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='ssss')
     def paramUpdate(self, name, value, category, profile):
-        pass
+        debug ("paramUpdate")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='ssia{ss}s')
     def presenceUpdate(self, entity, show, priority, statuses, profile):
-        pass
+        debug ("presenceUpdate")
 
     @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
                          signature='sss')
     def subscribe(self, sub_type, entity, profile):
-        pass
+        debug ("subscribe")
 
     @dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX,
                          signature='sa{ss}')
     def updatedValue(self, name, value):
-        pass
+        debug ("updatedValue")
 
 
     ### methods ###    
@@ -118,151 +118,181 @@
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='ss', out_signature='')
     def addContact(self, entity, profile_key="@DEFAULT@"):
+        debug ("addContact")
         return self.cb["addContact"](unicode(entity), unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='ssss', out_signature='s')
     def callMenu(self, category, name, menu_type, profile_key):
+        debug ("callMenu")
         return self.cb["callMenu"](unicode(category), unicode(name), unicode(menu_type), unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='sba{ss}', out_signature='')
     def confirmationAnswer(self, id, accepted, data):
+        debug ("confirmationAnswer")
         return self.cb["confirmationAnswer"](unicode(id), accepted, data)
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='s', out_signature='')
     def connect(self, profile_key="@DEFAULT@"):
+        debug ("connect")
         return self.cb["connect"](unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='s', out_signature='i')
     def createProfile(self, profile):
+        debug ("createProfile")
         return self.cb["createProfile"](unicode(profile))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='ss', out_signature='')
     def delContact(self, entity, profile_key="@DEFAULT@"):
+        debug ("delContact")
         return self.cb["delContact"](unicode(entity), unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='s', out_signature='i')
     def deleteProfile(self, profile):
+        debug ("deleteProfile")
         return self.cb["deleteProfile"](unicode(profile))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='s', out_signature='')
     def disconnect(self, profile_key="@DEFAULT@"):
+        debug ("disconnect")
         return self.cb["disconnect"](unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='s', out_signature='a(sa{ss}as)')
     def getContacts(self, profile_key="@DEFAULT@"):
+        debug ("getContacts")
         return self.cb["getContacts"](unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='ssi', out_signature='a{i(ss)}')
     def getHistory(self, from_jid, to_jid, size):
+        debug ("getHistory")
         return self.cb["getHistory"](unicode(from_jid), unicode(to_jid), size)
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='sss', out_signature='s')
     def getMenuHelp(self, category, name, menu_type):
+        debug ("getMenuHelp")
         return self.cb["getMenuHelp"](unicode(category), unicode(name), unicode(menu_type))
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='', out_signature='a(sss)')
     def getMenus(self, ):
+        debug ("getMenus")
         return self.cb["getMenus"]()
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
-                         in_signature='sss', out_signature='s')
-    def getParamA(self, name, category, profile_key="@DEFAULT@"):
-        return self.cb["getParamA"](unicode(name), unicode(category), unicode(profile_key))
+                         in_signature='ssss', out_signature='s')
+    def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"):
+        debug ("getParamA")
+        return self.cb["getParamA"](unicode(name), unicode(category), unicode(attribute), unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='s', out_signature='s')
     def getParams(self, profile_key="@DEFAULT@"):
+        debug ("getParams")
         return self.cb["getParams"](unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='', out_signature='as')
     def getParamsCategories(self, ):
+        debug ("getParamsCategories")
         return self.cb["getParamsCategories"]()
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='ss', out_signature='s')
     def getParamsForCategory(self, category, profile_key="@DEFAULT@"):
+        debug ("getParamsForCategory")
         return self.cb["getParamsForCategory"](unicode(category), unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='s', out_signature='s')
     def getParamsUI(self, profile_key="@DEFAULT@"):
+        debug ("getParamsUI")
         return self.cb["getParamsUI"](unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='s', out_signature='a{sa{s(sia{ss})}}')
     def getPresenceStatus(self, profile_key="@DEFAULT@"):
+        debug ("getPresenceStatus")
         return self.cb["getPresenceStatus"](unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='s', out_signature='s')
     def getProfileName(self, profile_key="@DEFAULT@"):
+        debug ("getProfileName")
         return self.cb["getProfileName"](unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='', out_signature='as')
     def getProfilesList(self, ):
+        debug ("getProfilesList")
         return self.cb["getProfilesList"]()
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='s', out_signature='a{ss}')
     def getProgress(self, id):
+        debug ("getProgress")
         return self.cb["getProgress"](unicode(id))
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='', out_signature='s')
     def getVersion(self, ):
+        debug ("getVersion")
         return self.cb["getVersion"]()
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='s', out_signature='a{ss}')
     def getWaitingSub(self, profile_key="@DEFAULT@"):
+        debug ("getWaitingSub")
         return self.cb["getWaitingSub"](unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='s', out_signature='b')
     def isConnected(self, profile_key="@DEFAULT@"):
+        debug ("isConnected")
         return self.cb["isConnected"](unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
                          in_signature='sa{ss}s', out_signature='s')
     def launchAction(self, action_type, data, profile_key="@DEFAULT@"):
+        debug ("launchAction")
         return self.cb["launchAction"](unicode(action_type), data, unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='sssi', out_signature='s')
     def registerNewAccount(self, login, password, host, port=5222):
+        debug ("registerNewAccount")
         return self.cb["registerNewAccount"](unicode(login), unicode(password), unicode(host), port)
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='sssss', out_signature='')
-    def sendMessage(self, to_jid, message, subject=, mess_type="chat", profile_key="@DEFAULT@"):
+    def sendMessage(self, to_jid, message, subject='', mess_type="chat", profile_key="@DEFAULT@"):
+        debug ("sendMessage")
         return self.cb["sendMessage"](unicode(to_jid), unicode(message), unicode(subject), unicode(mess_type), unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='ssss', out_signature='')
     def setParam(self, name, value, category, profile_key="@DEFAULT@"):
+        debug ("setParam")
         return self.cb["setParam"](unicode(name), unicode(value), unicode(category), unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='ssia{ss}s', out_signature='')
     def setPresence(self, to_jid='', show='', priority=0, statuses={}, profile_key="@DEFAULT@"):
+        debug ("setPresence")
         return self.cb["setPresence"](unicode(to_jid), unicode(show), priority, statuses, unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
                          in_signature='sss', out_signature='')
     def subscription(self, sub_type, entity, profile_key="@DEFAULT@"):
+        debug ("subscription")
         return self.cb["subscription"](unicode(sub_type), unicode(entity), unicode(profile_key))