Mercurial > libervia-backend
comparison frontends/src/bridge/DBus.py @ 423:6c20c76abdcc
backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
- getParams, getParamsForCategory and getParamsUI are now asynchronous
primitivus: management of asynchronous getParamsUI
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 07 Nov 2011 00:09:22 +0100 |
parents | 28e4299d4553 |
children | e4e9187e3b5b |
comparison
equal
deleted
inserted
replaced
422:5a18c5f08d9b | 423:6c20c76abdcc |
---|---|
109 return self.db_core_iface.getMenus() | 109 return self.db_core_iface.getMenus() |
110 | 110 |
111 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"): | 111 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"): |
112 return unicode(self.db_core_iface.getParamA(name, category, attribute, profile_key)) | 112 return unicode(self.db_core_iface.getParamA(name, category, attribute, profile_key)) |
113 | 113 |
114 def getParams(self, profile_key="@DEFAULT@"): | 114 def getParams(self, profile_key="@DEFAULT@", callback=None, errback=None): |
115 return unicode(self.db_core_iface.getParams(profile_key)) | 115 return unicode(self.db_core_iface.getParams(profile_key, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))) |
116 | 116 |
117 def getParamsCategories(self, ): | 117 def getParamsCategories(self, ): |
118 return self.db_core_iface.getParamsCategories() | 118 return self.db_core_iface.getParamsCategories() |
119 | 119 |
120 def getParamsForCategory(self, category, profile_key="@DEFAULT@"): | 120 def getParamsForCategory(self, category, profile_key="@DEFAULT@", callback=None, errback=None): |
121 return unicode(self.db_core_iface.getParamsForCategory(category, profile_key)) | 121 return unicode(self.db_core_iface.getParamsForCategory(category, profile_key, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))) |
122 | 122 |
123 def getParamsUI(self, profile_key="@DEFAULT@"): | 123 def getParamsUI(self, profile_key="@DEFAULT@", callback=None, errback=None): |
124 return unicode(self.db_core_iface.getParamsUI(profile_key)) | 124 return unicode(self.db_core_iface.getParamsUI(profile_key, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))) |
125 | 125 |
126 def getPresenceStatus(self, profile_key="@DEFAULT@"): | 126 def getPresenceStatus(self, profile_key="@DEFAULT@"): |
127 return self.db_core_iface.getPresenceStatus(profile_key) | 127 return self.db_core_iface.getPresenceStatus(profile_key) |
128 | 128 |
129 def getProfileName(self, profile_key="@DEFAULT@"): | 129 def getProfileName(self, profile_key="@DEFAULT@"): |