comparison frontends/src/bridge/dbus_bridge.py @ 2443:81a45e7886c9

core: added a mechanism to associate short names to namespaces: - new internal registerNamespace can be used by a plugin to associate a short name to a namespace - new NamespacesGet bridge method retrieve those associations
author Goffi <goffi@goffi.org>
date Sun, 19 Nov 2017 16:46:07 +0100
parents 8b37a62336c3
children 0046283a285d
comparison
equal deleted inserted replaced
2442:b8ffb7f8056b 2443:81a45e7886c9
502 if errback is None: 502 if errback is None:
503 errback = log.error 503 errback = log.error
504 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) 504 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
505 return self.db_core_iface.messageSend(to_jid, message, subject, mess_type, extra, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) 505 return self.db_core_iface.messageSend(to_jid, message, subject, mess_type, extra, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
506 506
507 def namespacesGet(self, callback=None, errback=None):
508 if callback is None:
509 error_handler = None
510 else:
511 if errback is None:
512 errback = log.error
513 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
514 kwargs={}
515 if callback is not None:
516 kwargs['timeout'] = const_TIMEOUT
517 kwargs['reply_handler'] = callback
518 kwargs['error_handler'] = error_handler
519 return self.db_core_iface.namespacesGet(**kwargs)
520
507 def paramsRegisterApp(self, xml, security_limit=-1, app='', callback=None, errback=None): 521 def paramsRegisterApp(self, xml, security_limit=-1, app='', callback=None, errback=None):
508 if callback is None: 522 if callback is None:
509 error_handler = None 523 error_handler = None
510 else: 524 else:
511 if errback is None: 525 if errback is None: