comparison frontends/src/bridge/dbus_bridge.py @ 2142:be96beb7ca14

core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
author Goffi <goffi@goffi.org>
date Mon, 06 Feb 2017 22:54:43 +0100
parents 2f264f3df280
children 1d3f73e065e1
comparison
equal deleted inserted replaced
2141:35762e9ce8b9 2142:be96beb7ca14
162 kwargs['timeout'] = const_TIMEOUT 162 kwargs['timeout'] = const_TIMEOUT
163 kwargs['reply_handler'] = callback 163 kwargs['reply_handler'] = callback
164 kwargs['error_handler'] = error_handler 164 kwargs['error_handler'] = error_handler
165 return self.db_core_iface.addContact(entity_jid, profile_key, **kwargs) 165 return self.db_core_iface.addContact(entity_jid, profile_key, **kwargs)
166 166
167 def asyncConnect(self, profile_key="@DEFAULT@", password='', callback=None, errback=None):
168 if callback is None:
169 error_handler = None
170 else:
171 if errback is None:
172 errback = log.error
173 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
174 return self.db_core_iface.asyncConnect(profile_key, password, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
175
176 def asyncCreateProfile(self, profile, password='', callback=None, errback=None): 167 def asyncCreateProfile(self, profile, password='', callback=None, errback=None):
177 if callback is None: 168 if callback is None:
178 error_handler = None 169 error_handler = None
179 else: 170 else:
180 if errback is None: 171 if errback is None:
207 if errback is None: 198 if errback is None:
208 errback = log.error 199 errback = log.error
209 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) 200 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
210 return self.db_core_iface.asyncGetParamsValuesFromCategory(category, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) 201 return self.db_core_iface.asyncGetParamsValuesFromCategory(category, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
211 202
203 def connect(self, profile_key="@DEFAULT@", password='', options={}, callback=None, errback=None):
204 if callback is None:
205 error_handler = None
206 else:
207 if errback is None:
208 errback = log.error
209 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
210 return self.db_core_iface.connect(profile_key, password, options, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
211
212 def delContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None): 212 def delContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
213 if callback is None: 213 if callback is None:
214 error_handler = None 214 error_handler = None
215 else: 215 else:
216 if errback is None: 216 if errback is None: