Mercurial > libervia-backend
comparison src/bridge/dbus_bridge.py @ 2126:2f264f3df280
core (menus): improvments:
- use the new convention for bridge names (getMenus ==> menusGet, etc.)
- menu now use canonical path, which is the untranslated path with each element stripped and lowercase, it must be unique by menu type
- added menuLaunch method to manually launch a menu like an action, canonical path is used instead of id
- added SECURITY_LIMIT_MAX constant
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 26 Jan 2017 20:29:48 +0100 |
parents | 9c861d07b5b6 |
children | be96beb7ca14 |
comparison
equal
deleted
inserted
replaced
2125:ca82c97db195 | 2126:2f264f3df280 |
---|---|
298 async_callbacks=None) | 298 async_callbacks=None) |
299 def getMainResource(self, contact_jid, profile_key="@DEFAULT@"): | 299 def getMainResource(self, contact_jid, profile_key="@DEFAULT@"): |
300 return self._callback("getMainResource", unicode(contact_jid), unicode(profile_key)) | 300 return self._callback("getMainResource", unicode(contact_jid), unicode(profile_key)) |
301 | 301 |
302 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 302 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
303 in_signature='ss', out_signature='s', | |
304 async_callbacks=None) | |
305 def getMenuHelp(self, menu_id, language): | |
306 return self._callback("getMenuHelp", unicode(menu_id), unicode(language)) | |
307 | |
308 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | |
309 in_signature='si', out_signature='a(ssasasa{ss})', | |
310 async_callbacks=None) | |
311 def getMenus(self, language, security_limit): | |
312 return self._callback("getMenus", unicode(language), security_limit) | |
313 | |
314 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | |
315 in_signature='ssss', out_signature='s', | 303 in_signature='ssss', out_signature='s', |
316 async_callbacks=None) | 304 async_callbacks=None) |
317 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"): | 305 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"): |
318 return self._callback("getParamA", unicode(name), unicode(category), unicode(attribute), unicode(profile_key)) | 306 return self._callback("getParamA", unicode(name), unicode(category), unicode(attribute), unicode(profile_key)) |
319 | 307 |
386 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 374 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
387 in_signature='s', out_signature='b', | 375 in_signature='s', out_signature='b', |
388 async_callbacks=None) | 376 async_callbacks=None) |
389 def loadParamsTemplate(self, filename): | 377 def loadParamsTemplate(self, filename): |
390 return self._callback("loadParamsTemplate", unicode(filename)) | 378 return self._callback("loadParamsTemplate", unicode(filename)) |
379 | |
380 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | |
381 in_signature='ss', out_signature='s', | |
382 async_callbacks=None) | |
383 def menuHelpGet(self, menu_id, language): | |
384 return self._callback("menuHelpGet", unicode(menu_id), unicode(language)) | |
385 | |
386 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | |
387 in_signature='sasa{ss}is', out_signature='a{ss}', | |
388 async_callbacks=('callback', 'errback')) | |
389 def menuLaunch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None): | |
390 return self._callback("menuLaunch", unicode(menu_type), path, data, security_limit, unicode(profile_key), callback=callback, errback=errback) | |
391 | |
392 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | |
393 in_signature='si', out_signature='a(ssasasa{ss})', | |
394 async_callbacks=None) | |
395 def menusGet(self, language, security_limit): | |
396 return self._callback("menusGet", unicode(language), security_limit) | |
391 | 397 |
392 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 398 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
393 in_signature='sa{ss}a{ss}sa{ss}s', out_signature='', | 399 in_signature='sa{ss}a{ss}sa{ss}s', out_signature='', |
394 async_callbacks=('callback', 'errback')) | 400 async_callbacks=('callback', 'errback')) |
395 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None): | 401 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None): |