backend, frontends: callbacks refactoring:

- launchAction is now async, and return a dictionary for its result
    - no more action_id, actionResult* are deprecated
    - callback system is about to be unified
This commit is contained in:
Goffi 2013-12-24 15:19:08 +01:00
commit 069a250b04
2 changed files with 151 additions and 78 deletions

View file

@ -378,10 +378,10 @@ class DbusObject(dbus.service.Object):
return self._callback("isConnected", unicode(profile_key))
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='sa{ss}s', out_signature='s',
async_callbacks=None)
def launchAction(self, action_type, data, profile_key="@DEFAULT@"):
return self._callback("launchAction", unicode(action_type), data, unicode(profile_key))
in_signature='sa{ss}s', out_signature='a{ss}',
async_callbacks=('callback', 'errback'))
def launchAction(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("launchAction", unicode(callback_id), data, unicode(profile_key), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='ssssi', out_signature='s',

View file

@ -104,6 +104,7 @@ doc_param_0=entity_jid: JID of the contact removed from roster
doc_param_1=%(doc_profile)s
[askConfirmation]
deprecated=
type=signal
category=core
sig_in=ssa{ss}s
@ -116,6 +117,7 @@ doc_param_2=data: conf_type dependent data
doc_param_3=%(doc_profile)s
[actionResult]
deprecated=
type=signal
category=core
sig_in=ssa{ss}s
@ -130,6 +132,7 @@ doc_param_2=data: answer_type specific data
doc_param_3=%(doc_profile)s
[actionResultExt]
deprecated=
type=signal
category=core
sig_in=ssa{sa{ss}}s
@ -533,18 +536,21 @@ doc_param_0=entity_jid: JID to remove from roster
doc_param_1=%(doc_profile_key)s
[launchAction]
async=
type=method
category=core
sig_in=sa{ss}s
sig_out=s
sig_out=a{ss}
param_2_default="@DEFAULT@"
doc=Launch a specific action
doc_param_0=action_type: type of the action which can be:
- button: A button is pushed
doc_param_1=data: action_type dependant data
doc=Launch a registred action
doc_param_0=callback_id: id of the registred callback
doc_param_1=data: optional data
doc_param_2=%(doc_profile_key)s
doc_return=dict where key can be:
- xmlui: a XMLUI need to be displayed
[confirmationAnswer]
deprecated=
type=method
category=core
sig_in=sba{ss}s