bridge refactoring: categories are now core and plugin instead of communication and request
This commit is contained in:
parent
ee98769ddf
commit
b3322dabae
5 changed files with 161 additions and 142 deletions
|
|
@ -28,8 +28,8 @@ from logging import debug, info
|
||||||
|
|
||||||
const_INT_PREFIX = "org.goffi.SAT" #Interface prefix
|
const_INT_PREFIX = "org.goffi.SAT" #Interface prefix
|
||||||
const_OBJ_PATH = '/org/goffi/SAT/bridge'
|
const_OBJ_PATH = '/org/goffi/SAT/bridge'
|
||||||
const_COMM_SUFFIX = ".communication"
|
const_CORE_SUFFIX = ".core"
|
||||||
const_REQ_SUFFIX = ".request"
|
const_PLUGIN_SUFFIX = ".plugin"
|
||||||
|
|
||||||
class DbusObject(dbus.service.Object):
|
class DbusObject(dbus.service.Object):
|
||||||
|
|
||||||
|
|
@ -43,272 +43,280 @@ class DbusObject(dbus.service.Object):
|
||||||
|
|
||||||
### signals ###
|
### signals ###
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_PLUGIN_SUFFIX,
|
||||||
|
signature='')
|
||||||
|
def dummySignal(self):
|
||||||
|
#FIXME: workaround for addSignal (doesn't work if one method doensn't
|
||||||
|
# already exist for plugins), probably missing some initialisation, need
|
||||||
|
# further investigations
|
||||||
|
pass
|
||||||
|
|
||||||
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='ssa{ss}')
|
signature='ssa{ss}')
|
||||||
def actionResult(self, answer_type, id, data):
|
def actionResult(self, answer_type, id, data):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='ssa{sa{ss}}')
|
signature='ssa{sa{ss}}')
|
||||||
def actionResultExt(self, answer_type, id, data):
|
def actionResultExt(self, answer_type, id, data):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='ssa{ss}')
|
signature='ssa{ss}')
|
||||||
def askConfirmation(self, conf_type, id, data):
|
def askConfirmation(self, conf_type, id, data):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='s')
|
signature='s')
|
||||||
def connected(self, profile):
|
def connected(self, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='ss')
|
signature='ss')
|
||||||
def connectionError(self, error_type, profile):
|
def connectionError(self, error_type, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='ss')
|
signature='ss')
|
||||||
def contactDeleted(self, entity, profile):
|
def contactDeleted(self, entity, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='s')
|
signature='s')
|
||||||
def disconnected(self, profile):
|
def disconnected(self, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='ssss')
|
signature='ssss')
|
||||||
def newAlert(self, message, title, alert_type, profile):
|
def newAlert(self, message, title, alert_type, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='sa{ss}ass')
|
signature='sa{ss}ass')
|
||||||
def newContact(self, contact, attributes, groups, profile):
|
def newContact(self, contact, attributes, groups, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='sssss')
|
signature='sssss')
|
||||||
def newMessage(self, from_jid, message, mess_type, to_jid, profile):
|
def newMessage(self, from_jid, message, mess_type, to_jid, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='ssss')
|
signature='ssss')
|
||||||
def paramUpdate(self, name, value, category, profile):
|
def paramUpdate(self, name, value, category, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='ssia{ss}s')
|
signature='ssia{ss}s')
|
||||||
def presenceUpdate(self, entity, show, priority, statuses, profile):
|
def presenceUpdate(self, entity, show, priority, statuses, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='sss')
|
signature='sss')
|
||||||
def subscribe(self, sub_type, entity, profile):
|
def subscribe(self, sub_type, entity, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@dbus.service.signal(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
signature='sa{ss}')
|
signature='sa{ss}s')
|
||||||
def updatedValue(self, name, value):
|
def updatedValue(self, name, value, profile):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
### methods ###
|
### methods ###
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ss', out_signature='',
|
in_signature='ss', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def addContact(self, entity, profile_key="@DEFAULT@"):
|
def addContact(self, entity, profile_key="@DEFAULT@"):
|
||||||
return self.cb["addContact"](unicode(entity), unicode(profile_key))
|
return self.cb["addContact"](unicode(entity), unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='',
|
in_signature='s', out_signature='',
|
||||||
async_callbacks=('callback', 'errback'))
|
async_callbacks=('callback', 'errback'))
|
||||||
def asyncConnect(self, profile_key="@DEFAULT@", callback=None, errback=None):
|
def asyncConnect(self, profile_key="@DEFAULT@", callback=None, errback=None):
|
||||||
return self.cb["asyncConnect"](unicode(profile_key), callback, errback)
|
return self.cb["asyncConnect"](unicode(profile_key), callback, errback)
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ssss', out_signature='s',
|
in_signature='ssss', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def callMenu(self, category, name, menu_type, profile_key):
|
def callMenu(self, category, name, menu_type, profile_key):
|
||||||
return self.cb["callMenu"](unicode(category), unicode(name), unicode(menu_type), unicode(profile_key))
|
return self.cb["callMenu"](unicode(category), unicode(name), unicode(menu_type), unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='sba{ss}', out_signature='',
|
in_signature='sba{ss}', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def confirmationAnswer(self, id, accepted, data):
|
def confirmationAnswer(self, id, accepted, data):
|
||||||
return self.cb["confirmationAnswer"](unicode(id), accepted, data)
|
return self.cb["confirmationAnswer"](unicode(id), accepted, data)
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='',
|
in_signature='s', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def connect(self, profile_key="@DEFAULT@"):
|
def connect(self, profile_key="@DEFAULT@"):
|
||||||
return self.cb["connect"](unicode(profile_key))
|
return self.cb["connect"](unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='i',
|
in_signature='s', out_signature='i',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def createProfile(self, profile):
|
def createProfile(self, profile):
|
||||||
return self.cb["createProfile"](unicode(profile))
|
return self.cb["createProfile"](unicode(profile))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ss', out_signature='',
|
in_signature='ss', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def delContact(self, entity, profile_key="@DEFAULT@"):
|
def delContact(self, entity, profile_key="@DEFAULT@"):
|
||||||
return self.cb["delContact"](unicode(entity), unicode(profile_key))
|
return self.cb["delContact"](unicode(entity), unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='i',
|
in_signature='s', out_signature='i',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def deleteProfile(self, profile):
|
def deleteProfile(self, profile):
|
||||||
return self.cb["deleteProfile"](unicode(profile))
|
return self.cb["deleteProfile"](unicode(profile))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='',
|
in_signature='s', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def disconnect(self, profile_key="@DEFAULT@"):
|
def disconnect(self, profile_key="@DEFAULT@"):
|
||||||
return self.cb["disconnect"](unicode(profile_key))
|
return self.cb["disconnect"](unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ss', out_signature='s',
|
in_signature='ss', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getConfig(self, section, name):
|
def getConfig(self, section, name):
|
||||||
return self.cb["getConfig"](unicode(section), unicode(name))
|
return self.cb["getConfig"](unicode(section), unicode(name))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='a(sa{ss}as)',
|
in_signature='s', out_signature='a(sa{ss}as)',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getContacts(self, profile_key="@DEFAULT@"):
|
def getContacts(self, profile_key="@DEFAULT@"):
|
||||||
return self.cb["getContacts"](unicode(profile_key))
|
return self.cb["getContacts"](unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ssi', out_signature='a{i(ss)}',
|
in_signature='ssi', out_signature='a{i(ss)}',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getHistory(self, from_jid, to_jid, size):
|
def getHistory(self, from_jid, to_jid, size):
|
||||||
return self.cb["getHistory"](unicode(from_jid), unicode(to_jid), size)
|
return self.cb["getHistory"](unicode(from_jid), unicode(to_jid), size)
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='sss', out_signature='s',
|
in_signature='sss', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getMenuHelp(self, category, name, menu_type):
|
def getMenuHelp(self, category, name, menu_type):
|
||||||
return self.cb["getMenuHelp"](unicode(category), unicode(name), unicode(menu_type))
|
return self.cb["getMenuHelp"](unicode(category), unicode(name), unicode(menu_type))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='', out_signature='a(sss)',
|
in_signature='', out_signature='a(sss)',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getMenus(self, ):
|
def getMenus(self, ):
|
||||||
return self.cb["getMenus"]()
|
return self.cb["getMenus"]()
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ssss', out_signature='s',
|
in_signature='ssss', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"):
|
def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"):
|
||||||
return self.cb["getParamA"](unicode(name), unicode(category), unicode(attribute), unicode(profile_key))
|
return self.cb["getParamA"](unicode(name), unicode(category), unicode(attribute), unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='s',
|
in_signature='s', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getParams(self, profile_key="@DEFAULT@"):
|
def getParams(self, profile_key="@DEFAULT@"):
|
||||||
return self.cb["getParams"](unicode(profile_key))
|
return self.cb["getParams"](unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='', out_signature='as',
|
in_signature='', out_signature='as',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getParamsCategories(self, ):
|
def getParamsCategories(self, ):
|
||||||
return self.cb["getParamsCategories"]()
|
return self.cb["getParamsCategories"]()
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ss', out_signature='s',
|
in_signature='ss', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getParamsForCategory(self, category, profile_key="@DEFAULT@"):
|
def getParamsForCategory(self, category, profile_key="@DEFAULT@"):
|
||||||
return self.cb["getParamsForCategory"](unicode(category), unicode(profile_key))
|
return self.cb["getParamsForCategory"](unicode(category), unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='s',
|
in_signature='s', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getParamsUI(self, profile_key="@DEFAULT@"):
|
def getParamsUI(self, profile_key="@DEFAULT@"):
|
||||||
return self.cb["getParamsUI"](unicode(profile_key))
|
return self.cb["getParamsUI"](unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='a{sa{s(sia{ss})}}',
|
in_signature='s', out_signature='a{sa{s(sia{ss})}}',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getPresenceStatus(self, profile_key="@DEFAULT@"):
|
def getPresenceStatus(self, profile_key="@DEFAULT@"):
|
||||||
return self.cb["getPresenceStatus"](unicode(profile_key))
|
return self.cb["getPresenceStatus"](unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='s',
|
in_signature='s', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getProfileName(self, profile_key="@DEFAULT@"):
|
def getProfileName(self, profile_key="@DEFAULT@"):
|
||||||
return self.cb["getProfileName"](unicode(profile_key))
|
return self.cb["getProfileName"](unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='', out_signature='as',
|
in_signature='', out_signature='as',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getProfilesList(self, ):
|
def getProfilesList(self, ):
|
||||||
return self.cb["getProfilesList"]()
|
return self.cb["getProfilesList"]()
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='a{ss}',
|
in_signature='s', out_signature='a{ss}',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getProgress(self, id):
|
def getProgress(self, id):
|
||||||
return self.cb["getProgress"](unicode(id))
|
return self.cb["getProgress"](unicode(id))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='', out_signature='s',
|
in_signature='', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getVersion(self, ):
|
def getVersion(self, ):
|
||||||
return self.cb["getVersion"]()
|
return self.cb["getVersion"]()
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='a{ss}',
|
in_signature='s', out_signature='a{ss}',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def getWaitingSub(self, profile_key="@DEFAULT@"):
|
def getWaitingSub(self, profile_key="@DEFAULT@"):
|
||||||
return self.cb["getWaitingSub"](unicode(profile_key))
|
return self.cb["getWaitingSub"](unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='s', out_signature='b',
|
in_signature='s', out_signature='b',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def isConnected(self, profile_key="@DEFAULT@"):
|
def isConnected(self, profile_key="@DEFAULT@"):
|
||||||
return self.cb["isConnected"](unicode(profile_key))
|
return self.cb["isConnected"](unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_REQ_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='sa{ss}s', out_signature='s',
|
in_signature='sa{ss}s', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def launchAction(self, action_type, data, profile_key="@DEFAULT@"):
|
def launchAction(self, action_type, data, profile_key="@DEFAULT@"):
|
||||||
return self.cb["launchAction"](unicode(action_type), data, unicode(profile_key))
|
return self.cb["launchAction"](unicode(action_type), data, unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ssssi', out_signature='s',
|
in_signature='ssssi', out_signature='s',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def registerNewAccount(self, login, password, email, host, port=5222):
|
def registerNewAccount(self, login, password, email, host, port=5222):
|
||||||
return self.cb["registerNewAccount"](unicode(login), unicode(password), unicode(email), unicode(host), port)
|
return self.cb["registerNewAccount"](unicode(login), unicode(password), unicode(email), unicode(host), port)
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='sssss', out_signature='',
|
in_signature='sssss', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
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@"):
|
||||||
return self.cb["sendMessage"](unicode(to_jid), unicode(message), unicode(subject), unicode(mess_type), unicode(profile_key))
|
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,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ssss', out_signature='',
|
in_signature='ssss', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def setParam(self, name, value, category, profile_key="@DEFAULT@"):
|
def setParam(self, name, value, category, profile_key="@DEFAULT@"):
|
||||||
return self.cb["setParam"](unicode(name), unicode(value), unicode(category), unicode(profile_key))
|
return self.cb["setParam"](unicode(name), unicode(value), unicode(category), unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ssia{ss}s', out_signature='',
|
in_signature='ssia{ss}s', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def setPresence(self, to_jid='', show='', priority=0, statuses={}, profile_key="@DEFAULT@"):
|
def setPresence(self, to_jid='', show='', priority=0, statuses={}, profile_key="@DEFAULT@"):
|
||||||
return self.cb["setPresence"](unicode(to_jid), unicode(show), priority, statuses, unicode(profile_key))
|
return self.cb["setPresence"](unicode(to_jid), unicode(show), priority, statuses, unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='sss', out_signature='',
|
in_signature='sss', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def subscription(self, sub_type, entity, profile_key="@DEFAULT@"):
|
def subscription(self, sub_type, entity, profile_key="@DEFAULT@"):
|
||||||
return self.cb["subscription"](unicode(sub_type), unicode(entity), unicode(profile_key))
|
return self.cb["subscription"](unicode(sub_type), unicode(entity), unicode(profile_key))
|
||||||
|
|
||||||
@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
|
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||||
in_signature='ssass', out_signature='',
|
in_signature='ssass', out_signature='',
|
||||||
async_callbacks=None)
|
async_callbacks=None)
|
||||||
def updateContact(self, entity, name, groups, profile_key="@DEFAULT@"):
|
def updateContact(self, entity, name, groups, profile_key="@DEFAULT@"):
|
||||||
|
|
@ -433,8 +441,8 @@ class DBusBridge(Bridge):
|
||||||
def subscribe(self, sub_type, entity, profile):
|
def subscribe(self, sub_type, entity, profile):
|
||||||
self.dbus_bridge.subscribe(sub_type, entity, profile)
|
self.dbus_bridge.subscribe(sub_type, entity, profile)
|
||||||
|
|
||||||
def updatedValue(self, name, value):
|
def updatedValue(self, name, value, profile):
|
||||||
self.dbus_bridge.updatedValue(name, value)
|
self.dbus_bridge.updatedValue(name, value, profile)
|
||||||
|
|
||||||
|
|
||||||
def register(self, name, callback):
|
def register(self, name, callback):
|
||||||
|
|
|
||||||
|
|
@ -344,7 +344,7 @@ class DbusConstructor(Constructor):
|
||||||
completion = {
|
completion = {
|
||||||
'sig_in':function['sig_in'] or '',
|
'sig_in':function['sig_in'] or '',
|
||||||
'sig_out':function['sig_out'] or '',
|
'sig_out':function['sig_out'] or '',
|
||||||
'category':'REQ' if function['category'] == 'request' else 'COMM',
|
'category':'PLUGIN' if function['category'] == 'plugin' else 'CORE',
|
||||||
'name':section,
|
'name':section,
|
||||||
'args':self.getArguments(function['sig_in'], name=arg_doc, default=default )
|
'args':self.getArguments(function['sig_in'], name=arg_doc, default=default )
|
||||||
}
|
}
|
||||||
|
|
@ -419,7 +419,7 @@ class DbusConstructor(Constructor):
|
||||||
completion = {
|
completion = {
|
||||||
'sig_in':function['sig_in'] or '',
|
'sig_in':function['sig_in'] or '',
|
||||||
'sig_out':function['sig_out'] or '',
|
'sig_out':function['sig_out'] or '',
|
||||||
'category':'req' if function['category'] == 'request' else 'comm',
|
'category':'plugin' if function['category'] == 'plugin' else 'core',
|
||||||
'name':section,
|
'name':section,
|
||||||
'args':self.getArguments(function['sig_in'], name=arg_doc, default=default)
|
'args':self.getArguments(function['sig_in'], name=arg_doc, default=default)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,21 +6,21 @@ doc_profile_key=profile_key: Profile key which can be either a magic (eg: @DEFAU
|
||||||
|
|
||||||
[connected]
|
[connected]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
doc=Connection is done
|
doc=Connection is done
|
||||||
doc_param_0=%(doc_profile)s
|
doc_param_0=%(doc_profile)s
|
||||||
|
|
||||||
[disconnected]
|
[disconnected]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
doc=Connection is finished or lost
|
doc=Connection is finished or lost
|
||||||
doc_param_0=%(doc_profile)s
|
doc_param_0=%(doc_profile)s
|
||||||
|
|
||||||
[connectionError]
|
[connectionError]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ss
|
sig_in=ss
|
||||||
doc=Something went wront with the connection
|
doc=Something went wront with the connection
|
||||||
doc_param_0=error_type: Why the connection got wrong, can be
|
doc_param_0=error_type: Why the connection got wrong, can be
|
||||||
|
|
@ -29,7 +29,7 @@ doc_param_1=%(doc_profile)s
|
||||||
|
|
||||||
[newContact]
|
[newContact]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=sa{ss}ass
|
sig_in=sa{ss}ass
|
||||||
doc=New contact received in roster
|
doc=New contact received in roster
|
||||||
doc_param_0=contact: JID from who the message is comming
|
doc_param_0=contact: JID from who the message is comming
|
||||||
|
|
@ -43,7 +43,7 @@ doc_param_3=%(doc_profile)s
|
||||||
|
|
||||||
[newMessage]
|
[newMessage]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=sssss
|
sig_in=sssss
|
||||||
doc=A message has been received
|
doc=A message has been received
|
||||||
doc_param_0=from_jid: JID where the message is comming from
|
doc_param_0=from_jid: JID where the message is comming from
|
||||||
|
|
@ -54,7 +54,7 @@ doc_param_4=%(doc_profile)s
|
||||||
|
|
||||||
[newAlert]
|
[newAlert]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ssss
|
sig_in=ssss
|
||||||
doc=A new alert happened
|
doc=A new alert happened
|
||||||
doc_param_0=message: Body of the alert
|
doc_param_0=message: Body of the alert
|
||||||
|
|
@ -66,7 +66,7 @@ doc_param_3=%(doc_profile)s
|
||||||
|
|
||||||
[presenceUpdate]
|
[presenceUpdate]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ssia{ss}s
|
sig_in=ssia{ss}s
|
||||||
doc=Somebody changed his presence informations.
|
doc=Somebody changed his presence informations.
|
||||||
doc_param_0=entity: JID from which we have presence informations
|
doc_param_0=entity: JID from which we have presence informations
|
||||||
|
|
@ -77,7 +77,7 @@ doc_param_4=%(doc_profile)s
|
||||||
|
|
||||||
[subscribe]
|
[subscribe]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=sss
|
sig_in=sss
|
||||||
doc=Somebody wants to be added in roster
|
doc=Somebody wants to be added in roster
|
||||||
doc_param_0=sub_type: Subscription states (see RFC 3921 #9)
|
doc_param_0=sub_type: Subscription states (see RFC 3921 #9)
|
||||||
|
|
@ -86,7 +86,7 @@ doc_param_2=%(doc_profile)s
|
||||||
|
|
||||||
[paramUpdate]
|
[paramUpdate]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ssss
|
sig_in=ssss
|
||||||
doc=A parameter has been changed
|
doc=A parameter has been changed
|
||||||
doc_param_0=name: Name of the updated parameter
|
doc_param_0=name: Name of the updated parameter
|
||||||
|
|
@ -96,7 +96,7 @@ doc_param_3=%(doc_profile)s
|
||||||
|
|
||||||
[contactDeleted]
|
[contactDeleted]
|
||||||
type=signal
|
type=signal
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ss
|
sig_in=ss
|
||||||
doc=A contact has been supressed from roster
|
doc=A contact has been supressed from roster
|
||||||
doc_param_0=entity: JID of the contact removed from roster
|
doc_param_0=entity: JID of the contact removed from roster
|
||||||
|
|
@ -104,7 +104,7 @@ doc_param_1=%(doc_profile)s
|
||||||
|
|
||||||
[askConfirmation]
|
[askConfirmation]
|
||||||
type=signal
|
type=signal
|
||||||
category=request
|
category=core
|
||||||
sig_in=ssa{ss}
|
sig_in=ssa{ss}
|
||||||
doc=A confirmation is needed for an action
|
doc=A confirmation is needed for an action
|
||||||
doc_param_0=conf_type: Type of the confirmation, can be:
|
doc_param_0=conf_type: Type of the confirmation, can be:
|
||||||
|
|
@ -115,7 +115,7 @@ doc_param_2=data: conf_type dependent data
|
||||||
|
|
||||||
[actionResult]
|
[actionResult]
|
||||||
type=signal
|
type=signal
|
||||||
category=request
|
category=core
|
||||||
sig_in=ssa{ss}
|
sig_in=ssa{ss}
|
||||||
doc=Requested result of an action
|
doc=Requested result of an action
|
||||||
doc_param_0=answer_type: Type of the answer, can be:
|
doc_param_0=answer_type: Type of the answer, can be:
|
||||||
|
|
@ -128,7 +128,7 @@ doc_param_2=data: answer_type specific data
|
||||||
|
|
||||||
[actionResultExt]
|
[actionResultExt]
|
||||||
type=signal
|
type=signal
|
||||||
category=request
|
category=core
|
||||||
sig_in=ssa{sa{ss}}
|
sig_in=ssa{sa{ss}}
|
||||||
doc=Requested result of an action (Extended)
|
doc=Requested result of an action (Extended)
|
||||||
doc_param_0=answer_type: Same as for [actionResult] but with the following additional one:
|
doc_param_0=answer_type: Same as for [actionResult] but with the following additional one:
|
||||||
|
|
@ -138,24 +138,25 @@ doc_param_2=data: answer_type specific data
|
||||||
|
|
||||||
[updatedValue]
|
[updatedValue]
|
||||||
type=signal
|
type=signal
|
||||||
category=request
|
category=core
|
||||||
sig_in=sa{ss}
|
sig_in=sa{ss}s
|
||||||
doc=A value has been updated
|
doc=A value has been updated
|
||||||
doc_param_0=name: Name of the updated value
|
doc_param_0=name: Name of the updated value
|
||||||
doc_param_1=value: New value
|
doc_param_1=value: New value
|
||||||
|
doc_param_2=%(doc_profile)s
|
||||||
|
|
||||||
;methods
|
;methods
|
||||||
|
|
||||||
[getVersion]
|
[getVersion]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=
|
sig_in=
|
||||||
sig_out=s
|
sig_out=s
|
||||||
doc=Get "Salut à Toi" version
|
doc=Get "Salut à Toi" version
|
||||||
|
|
||||||
[getProfileName]
|
[getProfileName]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=s
|
sig_out=s
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -165,14 +166,14 @@ doc_return=Real profile name, or empty string if the profile doesn't exist
|
||||||
|
|
||||||
[getProfilesList]
|
[getProfilesList]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=
|
sig_in=
|
||||||
sig_out=as
|
sig_out=as
|
||||||
doc=Get all profiles
|
doc=Get all profiles
|
||||||
|
|
||||||
[createProfile]
|
[createProfile]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=i
|
sig_out=i
|
||||||
doc=Create a new profile
|
doc=Create a new profile
|
||||||
|
|
@ -183,7 +184,7 @@ doc_return=status of the creation:
|
||||||
|
|
||||||
[deleteProfile]
|
[deleteProfile]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=i
|
sig_out=i
|
||||||
doc=Delete a profile
|
doc=Delete a profile
|
||||||
|
|
@ -195,7 +196,7 @@ doc_return=status of the deletion:
|
||||||
[registerNewAccount]
|
[registerNewAccount]
|
||||||
deprecated=
|
deprecated=
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ssssi
|
sig_in=ssssi
|
||||||
sig_out=s
|
sig_out=s
|
||||||
param_4_default=5222
|
param_4_default=5222
|
||||||
|
|
@ -208,7 +209,7 @@ doc_param_4=port: port of the server to register to
|
||||||
|
|
||||||
[connect]
|
[connect]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=
|
sig_out=
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -218,7 +219,7 @@ doc_param_0=%(doc_profile_key)s
|
||||||
[asyncConnect]
|
[asyncConnect]
|
||||||
async=
|
async=
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=
|
sig_out=
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -227,7 +228,7 @@ doc_param_0=%(doc_profile_key)s
|
||||||
|
|
||||||
[disconnect]
|
[disconnect]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=
|
sig_out=
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -236,7 +237,7 @@ doc_param_0=%(doc_profile_key)s
|
||||||
|
|
||||||
[isConnected]
|
[isConnected]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=b
|
sig_out=b
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -245,7 +246,7 @@ doc_param_0=%(doc_profile_key)s
|
||||||
|
|
||||||
[getContacts]
|
[getContacts]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=a(sa{ss}as)
|
sig_out=a(sa{ss}as)
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -258,7 +259,7 @@ doc_return=array of tuples with the following values:
|
||||||
|
|
||||||
[getPresenceStatus]
|
[getPresenceStatus]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=a{sa{s(sia{ss})}}
|
sig_out=a{sa{s(sia{ss})}}
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -269,7 +270,7 @@ doc_return=Dict of presence with bare JID of contact as key, and value as follow
|
||||||
|
|
||||||
[getWaitingSub]
|
[getWaitingSub]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=a{ss}
|
sig_out=a{ss}
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -279,7 +280,7 @@ doc_return=Dict where contact JID is the key, and value is the subscription type
|
||||||
|
|
||||||
[sendMessage]
|
[sendMessage]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=sssss
|
sig_in=sssss
|
||||||
sig_out=
|
sig_out=
|
||||||
param_2_default=''
|
param_2_default=''
|
||||||
|
|
@ -294,7 +295,7 @@ doc_param_4=%(doc_profile_key)s
|
||||||
|
|
||||||
[setPresence]
|
[setPresence]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ssia{ss}s
|
sig_in=ssia{ss}s
|
||||||
sig_out=
|
sig_out=
|
||||||
param_0_default=''
|
param_0_default=''
|
||||||
|
|
@ -311,7 +312,7 @@ doc_param_4=%(doc_profile_key)s
|
||||||
|
|
||||||
[subscription]
|
[subscription]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=sss
|
sig_in=sss
|
||||||
sig_out=
|
sig_out=
|
||||||
param_2_default="@DEFAULT@"
|
param_2_default="@DEFAULT@"
|
||||||
|
|
@ -322,7 +323,7 @@ doc_param_2=%(doc_profile_key)s
|
||||||
|
|
||||||
[getConfig]
|
[getConfig]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ss
|
sig_in=ss
|
||||||
sig_out=s
|
sig_out=s
|
||||||
doc=get main configuration option
|
doc=get main configuration option
|
||||||
|
|
@ -331,7 +332,7 @@ doc_param_1=name: name of the option
|
||||||
|
|
||||||
[setParam]
|
[setParam]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ssss
|
sig_in=ssss
|
||||||
sig_out=
|
sig_out=
|
||||||
param_3_default="@DEFAULT@"
|
param_3_default="@DEFAULT@"
|
||||||
|
|
@ -343,7 +344,7 @@ doc_param_3=%(doc_profile_key)s
|
||||||
|
|
||||||
[getParamA]
|
[getParamA]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ssss
|
sig_in=ssss
|
||||||
sig_out=s
|
sig_out=s
|
||||||
param_2_default="value"
|
param_2_default="value"
|
||||||
|
|
@ -356,7 +357,7 @@ doc_param_3=%(doc_profile_key)s
|
||||||
|
|
||||||
[getParamsUI]
|
[getParamsUI]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=s
|
sig_out=s
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -365,7 +366,7 @@ doc_param_0=%(doc_profile_key)s
|
||||||
|
|
||||||
[getParams]
|
[getParams]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=s
|
sig_out=s
|
||||||
param_0_default="@DEFAULT@"
|
param_0_default="@DEFAULT@"
|
||||||
|
|
@ -374,7 +375,7 @@ doc_param_0=%(doc_profile_key)s
|
||||||
|
|
||||||
[getParamsForCategory]
|
[getParamsForCategory]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ss
|
sig_in=ss
|
||||||
sig_out=s
|
sig_out=s
|
||||||
param_1_default="@DEFAULT@"
|
param_1_default="@DEFAULT@"
|
||||||
|
|
@ -384,7 +385,7 @@ doc_param_1=%(doc_profile_key)s
|
||||||
|
|
||||||
[getParamsCategories]
|
[getParamsCategories]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=
|
sig_in=
|
||||||
sig_out=as
|
sig_out=as
|
||||||
doc=Get all categories currently existing in parameters
|
doc=Get all categories currently existing in parameters
|
||||||
|
|
@ -392,7 +393,7 @@ doc_return=list of categories
|
||||||
|
|
||||||
[getHistory]
|
[getHistory]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ssi
|
sig_in=ssi
|
||||||
sig_out=a{i(ss)}
|
sig_out=a{i(ss)}
|
||||||
doc=Get history of a communication between two entities
|
doc=Get history of a communication between two entities
|
||||||
|
|
@ -403,7 +404,7 @@ doc_return=Dict where key is timestamp (seconds this the Epoch), and value is a
|
||||||
|
|
||||||
[addContact]
|
[addContact]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ss
|
sig_in=ss
|
||||||
sig_out=
|
sig_out=
|
||||||
param_1_default="@DEFAULT@"
|
param_1_default="@DEFAULT@"
|
||||||
|
|
@ -413,7 +414,7 @@ doc_param_1=%(doc_profile_key)s
|
||||||
|
|
||||||
[updateContact]
|
[updateContact]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ssass
|
sig_in=ssass
|
||||||
sig_out=
|
sig_out=
|
||||||
param_3_default="@DEFAULT@"
|
param_3_default="@DEFAULT@"
|
||||||
|
|
@ -425,7 +426,7 @@ doc_param_3=%(doc_profile_key)s
|
||||||
|
|
||||||
[delContact]
|
[delContact]
|
||||||
type=method
|
type=method
|
||||||
category=communication
|
category=core
|
||||||
sig_in=ss
|
sig_in=ss
|
||||||
sig_out=
|
sig_out=
|
||||||
param_1_default="@DEFAULT@"
|
param_1_default="@DEFAULT@"
|
||||||
|
|
@ -435,7 +436,7 @@ doc_param_1=%(doc_profile_key)s
|
||||||
|
|
||||||
[launchAction]
|
[launchAction]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=sa{ss}s
|
sig_in=sa{ss}s
|
||||||
sig_out=s
|
sig_out=s
|
||||||
param_2_default="@DEFAULT@"
|
param_2_default="@DEFAULT@"
|
||||||
|
|
@ -447,7 +448,7 @@ doc_param_2=%(doc_profile_key)s
|
||||||
|
|
||||||
[confirmationAnswer]
|
[confirmationAnswer]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=sba{ss}
|
sig_in=sba{ss}
|
||||||
sig_out=
|
sig_out=
|
||||||
doc=Give answer to a confirmation request
|
doc=Give answer to a confirmation request
|
||||||
|
|
@ -457,7 +458,7 @@ doc_param_2=data: action specific data
|
||||||
|
|
||||||
[getProgress]
|
[getProgress]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=s
|
sig_in=s
|
||||||
sig_out=a{ss}
|
sig_out=a{ss}
|
||||||
doc=Get progress information for an action
|
doc=Get progress information for an action
|
||||||
|
|
@ -468,7 +469,7 @@ doc_return=dict with progress information:
|
||||||
|
|
||||||
[getMenus]
|
[getMenus]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=
|
sig_in=
|
||||||
sig_out=a(sss)
|
sig_out=a(sss)
|
||||||
doc=Get all additional menus
|
doc=Get all additional menus
|
||||||
|
|
@ -480,7 +481,7 @@ doc_return=list of tuple with the following value:
|
||||||
|
|
||||||
[getMenuHelp]
|
[getMenuHelp]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=sss
|
sig_in=sss
|
||||||
sig_out=s
|
sig_out=s
|
||||||
param_2="NORMAL"
|
param_2="NORMAL"
|
||||||
|
|
@ -492,7 +493,7 @@ doc_return=Help string
|
||||||
|
|
||||||
[callMenu]
|
[callMenu]
|
||||||
type=method
|
type=method
|
||||||
category=request
|
category=core
|
||||||
sig_in=ssss
|
sig_in=ssss
|
||||||
sig_out=s
|
sig_out=s
|
||||||
doc=Execute action associated with a menu
|
doc=Execute action associated with a menu
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ from logging import debug, info
|
||||||
|
|
||||||
const_INT_PREFIX = "org.goffi.SAT" #Interface prefix
|
const_INT_PREFIX = "org.goffi.SAT" #Interface prefix
|
||||||
const_OBJ_PATH = '/org/goffi/SAT/bridge'
|
const_OBJ_PATH = '/org/goffi/SAT/bridge'
|
||||||
const_COMM_SUFFIX = ".communication"
|
const_CORE_SUFFIX = ".core"
|
||||||
const_REQ_SUFFIX = ".request"
|
const_PLUGIN_SUFFIX = ".plugin"
|
||||||
|
|
||||||
class DbusObject(dbus.service.Object):
|
class DbusObject(dbus.service.Object):
|
||||||
|
|
||||||
|
|
@ -43,6 +43,14 @@ class DbusObject(dbus.service.Object):
|
||||||
|
|
||||||
### signals ###
|
### signals ###
|
||||||
|
|
||||||
|
@dbus.service.signal(const_INT_PREFIX+const_PLUGIN_SUFFIX,
|
||||||
|
signature='')
|
||||||
|
def dummySignal(self):
|
||||||
|
#FIXME: workaround for addSignal (doesn't work if one method doensn't
|
||||||
|
# already exist for plugins), probably missing some initialisation, need
|
||||||
|
# further investigations
|
||||||
|
pass
|
||||||
|
|
||||||
##SIGNALS_PART##
|
##SIGNALS_PART##
|
||||||
|
|
||||||
### methods ###
|
### methods ###
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from bridge_frontend import BridgeFrontend
|
from bridge_frontend import BridgeFrontend
|
||||||
import dbus, dbus.glib
|
import dbus, dbus.glib
|
||||||
from logging import debug
|
from logging import debug, error
|
||||||
|
|
||||||
const_INT_PREFIX = "org.goffi.SAT" #Interface prefix
|
const_INT_PREFIX = "org.goffi.SAT" #Interface prefix
|
||||||
const_OBJ_PATH = '/org/goffi/SAT/bridge'
|
const_OBJ_PATH = '/org/goffi/SAT/bridge'
|
||||||
const_COMM_SUFFIX = ".communication"
|
const_CORE_SUFFIX = ".core"
|
||||||
const_REQ_SUFFIX = ".request"
|
const_PLUGIN_SUFFIX = ".plugin"
|
||||||
|
|
||||||
class BridgeExceptionNoService(Exception):
|
class BridgeExceptionNoService(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
@ -37,97 +37,99 @@ class DBusBridgeFrontend(BridgeFrontend):
|
||||||
self.sessions_bus = dbus.SessionBus()
|
self.sessions_bus = dbus.SessionBus()
|
||||||
self.db_object = self.sessions_bus.get_object(const_INT_PREFIX,
|
self.db_object = self.sessions_bus.get_object(const_INT_PREFIX,
|
||||||
const_OBJ_PATH)
|
const_OBJ_PATH)
|
||||||
self.db_comm_iface = dbus.Interface(self.db_object,
|
self.db_core_iface = dbus.Interface(self.db_object,
|
||||||
dbus_interface=const_INT_PREFIX + const_COMM_SUFFIX)
|
dbus_interface=const_INT_PREFIX + const_CORE_SUFFIX)
|
||||||
self.db_req_iface = dbus.Interface(self.db_object,
|
self.db_plugin_iface = dbus.Interface(self.db_object,
|
||||||
dbus_interface=const_INT_PREFIX + const_REQ_SUFFIX)
|
dbus_interface=const_INT_PREFIX + const_PLUGIN_SUFFIX)
|
||||||
except dbus.exceptions.DBusException,e:
|
except dbus.exceptions.DBusException,e:
|
||||||
if e._dbus_error_name=='org.freedesktop.DBus.Error.ServiceUnknown':
|
if e._dbus_error_name=='org.freedesktop.DBus.Error.ServiceUnknown':
|
||||||
raise BridgeExceptionNoService
|
raise BridgeExceptionNoService
|
||||||
else:
|
else:
|
||||||
raise e
|
raise e
|
||||||
#props = self.db_comm_iface.getProperties()
|
#props = self.db_core_iface.getProperties()
|
||||||
|
|
||||||
def register(self, functionName, handler, iface="communication"):
|
def register(self, functionName, handler, iface="core"):
|
||||||
if iface == "communication":
|
if iface == "core":
|
||||||
self.db_comm_iface.connect_to_signal(functionName, handler)
|
self.db_core_iface.connect_to_signal(functionName, handler)
|
||||||
elif iface == "request":
|
elif iface == "plugin":
|
||||||
self.db_req_iface.connect_to_signal(functionName, handler)
|
self.db_plugin_iface.connect_to_signal(functionName, handler)
|
||||||
|
else:
|
||||||
|
error(_('Unknown interface'))
|
||||||
|
|
||||||
##METHODS_PART##
|
##METHODS_PART##
|
||||||
|
|
||||||
#methods from plugins
|
#methods from plugins
|
||||||
def getRoomJoined(self, profile_key='@DEFAULT@'):
|
def getRoomJoined(self, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.getRoomJoined(profile_key)
|
return self.db_plugin_iface.getRoomJoined(profile_key)
|
||||||
|
|
||||||
def getRoomSubjects(self, profile_key='@DEFAULT@'):
|
def getRoomSubjects(self, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.getRoomSubjects(profile_key)
|
return self.db_plugin_iface.getRoomSubjects(profile_key)
|
||||||
|
|
||||||
def joinMUC(self, service, roomId, nick, profile_key='@DEFAULT@'):
|
def joinMUC(self, service, roomId, nick, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.joinMUC(service, roomId, nick, profile_key)
|
return self.db_plugin_iface.joinMUC(service, roomId, nick, profile_key)
|
||||||
|
|
||||||
def tarotGameLaunch(self, players, profile_key='@DEFAULT@'):
|
def tarotGameLaunch(self, players, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.tarotGameLaunch(players, profile_key)
|
return self.db_plugin_iface.tarotGameLaunch(players, profile_key)
|
||||||
|
|
||||||
def tarotGameCreate(self, room_jid, players, profile_key='@DEFAULT@'):
|
def tarotGameCreate(self, room_jid, players, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.tarotGameCreate(room_jid, players, profile_key)
|
return self.db_plugin_iface.tarotGameCreate(room_jid, players, profile_key)
|
||||||
|
|
||||||
def tarotGameReady(self, player, referee, profile_key='@DEFAULT@'):
|
def tarotGameReady(self, player, referee, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.tarotGameReady(player, referee, profile_key)
|
return self.db_plugin_iface.tarotGameReady(player, referee, profile_key)
|
||||||
|
|
||||||
def tarotGameContratChoosed(self, player, referee, contrat, profile_key='@DEFAULT@'):
|
def tarotGameContratChoosed(self, player, referee, contrat, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.tarotGameContratChoosed(player, referee, contrat, profile_key)
|
return self.db_plugin_iface.tarotGameContratChoosed(player, referee, contrat, profile_key)
|
||||||
|
|
||||||
def tarotGamePlayCards(self, player, referee, cards, profile_key='@DEFAULT@'):
|
def tarotGamePlayCards(self, player, referee, cards, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.tarotGamePlayCards(player, referee, cards, profile_key)
|
return self.db_plugin_iface.tarotGamePlayCards(player, referee, cards, profile_key)
|
||||||
|
|
||||||
def quizGameLaunch(self, players, profile_key='@DEFAULT@'):
|
def quizGameLaunch(self, players, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.quizGameLaunch(players, profile_key)
|
return self.db_plugin_iface.quizGameLaunch(players, profile_key)
|
||||||
|
|
||||||
def quizGameCreate(self, room_jid, players, profile_key='@DEFAULT@'):
|
def quizGameCreate(self, room_jid, players, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.quizGameCreate(room_jid, players, profile_key)
|
return self.db_plugin_iface.quizGameCreate(room_jid, players, profile_key)
|
||||||
|
|
||||||
def quizGameReady(self, player, referee, profile_key='@DEFAULT@'):
|
def quizGameReady(self, player, referee, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.quizGameReady(player, referee, profile_key)
|
return self.db_plugin_iface.quizGameReady(player, referee, profile_key)
|
||||||
|
|
||||||
def quizGameAnswer(self, player, referee, answer, profile_key='@DEFAULT@'):
|
def quizGameAnswer(self, player, referee, answer, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.quizGameAnswer(player, referee, answer, profile_key)
|
return self.db_plugin_iface.quizGameAnswer(player, referee, answer, profile_key)
|
||||||
|
|
||||||
def sendFile(self, to, path, profile_key='@DEFAULT@'):
|
def sendFile(self, to, path, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.sendFile(to, path, profile_key)
|
return self.db_plugin_iface.sendFile(to, path, profile_key)
|
||||||
|
|
||||||
def findGateways(self, target, profile_key='@DEFAULT@'):
|
def findGateways(self, target, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.findGateways(target, profile_key)
|
return self.db_plugin_iface.findGateways(target, profile_key)
|
||||||
|
|
||||||
def getCard(self, target, profile_key='@DEFAULT@'):
|
def getCard(self, target, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.getCard(target, profile_key)
|
return self.db_plugin_iface.getCard(target, profile_key)
|
||||||
|
|
||||||
def getCardCache(self, target):
|
def getCardCache(self, target):
|
||||||
return self.db_comm_iface.getCardCache(target)
|
return self.db_plugin_iface.getCardCache(target)
|
||||||
|
|
||||||
def getAvatarFile(self, hash):
|
def getAvatarFile(self, hash):
|
||||||
return self.db_comm_iface.getAvatarFile(hash)
|
return self.db_plugin_iface.getAvatarFile(hash)
|
||||||
|
|
||||||
def in_band_register(self, target, profile_key='@DEFAULT@'):
|
def in_band_register(self, target, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.in_band_register(target, profile_key)
|
return self.db_plugin_iface.in_band_register(target, profile_key)
|
||||||
|
|
||||||
def gatewayRegister(self, action, target, data, profile_key='@DEFAULT@'):
|
def gatewayRegister(self, action, target, data, profile_key='@DEFAULT@'):
|
||||||
if data == None:
|
if data == None:
|
||||||
data = [('', '')] #XXX: we have to do this awful hack because python dbus need to guess the signature
|
data = [('', '')] #XXX: we have to do this awful hack because python dbus need to guess the signature
|
||||||
return self.db_req_iface.gatewayRegister(action, target, data, profile_key)
|
return self.db_plugin_iface.gatewayRegister(action, target, data, profile_key)
|
||||||
|
|
||||||
def getLastMicroblogs(self, jid, max_items, profile_key='@DEFAULT@', callback=None, errback=None):
|
def getLastMicroblogs(self, jid, max_items, profile_key='@DEFAULT@', callback=None, errback=None):
|
||||||
return self.db_comm_iface.getLastMicroblogs(jid, max_items, profile_key, reply_handler=callback, error_handler=errback)
|
return self.db_plugin_iface.getLastMicroblogs(jid, max_items, profile_key, reply_handler=callback, error_handler=errback)
|
||||||
|
|
||||||
def getMblogNodes(self, profile_key='@DEFAULT@', callback=None, errback=None):
|
def getMblogNodes(self, profile_key='@DEFAULT@', callback=None, errback=None):
|
||||||
return self.db_comm_iface.getMblogNodes(profile_key, reply_handler=callback, error_handler=errback)
|
return self.db_plugin_iface.getMblogNodes(profile_key, reply_handler=callback, error_handler=errback)
|
||||||
|
|
||||||
def sendGroupBlog(self, groups, message, profile_key='@DEFAULT@'):
|
def sendGroupBlog(self, groups, message, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.sendGroupBlog(groups, message, profile_key)
|
return self.db_plugin_iface.sendGroupBlog(groups, message, profile_key)
|
||||||
|
|
||||||
def sendPersonalEvent(self, event_type, data, profile_key='@DEFAULT@'):
|
def sendPersonalEvent(self, event_type, data, profile_key='@DEFAULT@'):
|
||||||
return self.db_comm_iface.sendPersonalEvent(event_type, data, profile_key)
|
return self.db_plugin_iface.sendPersonalEvent(event_type, data, profile_key)
|
||||||
|
|
||||||
def setMicroblogAccess(self, access="presence", profile_key='@DEFAULT@', callback=None, errback=None):
|
def setMicroblogAccess(self, access="presence", profile_key='@DEFAULT@', callback=None, errback=None):
|
||||||
return self.db_comm_iface.setMicroblogAccess(access, profile_key, reply_handler=callback, error_handler=errback)
|
return self.db_plugin_iface.setMicroblogAccess(access, profile_key, reply_handler=callback, error_handler=errback)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue