comparison sat/bridge/dbus_bridge.py @ 2628:779351da2c13

core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation: generation of D-Bus bridge has been broken by black formatting tool, this patch fixes this.
author Goffi <goffi@goffi.org>
date Sun, 01 Jul 2018 20:37:58 +0200
parents 56f94936df1e
children 712cb4ff3e13
comparison
equal deleted inserted replaced
2627:163aab916bcf 2628:779351da2c13
26 26
27 log = getLogger(__name__) 27 log = getLogger(__name__)
28 from twisted.internet.defer import Deferred 28 from twisted.internet.defer import Deferred
29 from sat.core.exceptions import BridgeInitError 29 from sat.core.exceptions import BridgeInitError
30 30
31 const_INT_PREFIX = "org.goffi.SAT" # Interface prefix 31 const_INT_PREFIX = "org.salutatoi.SAT" # Interface prefix
32 const_ERROR_PREFIX = const_INT_PREFIX + ".error" 32 const_ERROR_PREFIX = const_INT_PREFIX + ".error"
33 const_OBJ_PATH = "/org/goffi/SAT/bridge" 33 const_OBJ_PATH = "/org/salutatoi/SAT/bridge"
34 const_CORE_SUFFIX = ".core" 34 const_CORE_SUFFIX = ".core"
35 const_PLUGIN_SUFFIX = ".plugin" 35 const_PLUGIN_SUFFIX = ".plugin"
36 36
37 37
38 class ParseError(Exception): 38 class ParseError(Exception):
126 # FIXME: workaround for addSignal (doesn't work if one method doensn't 126 # FIXME: workaround for addSignal (doesn't work if one method doensn't
127 # already exist for plugins), probably missing some initialisation, need 127 # already exist for plugins), probably missing some initialisation, need
128 # further investigations 128 # further investigations
129 pass 129 pass
130 130
131 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="a{ss}sis") 131 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
132 signature='a{ss}sis')
132 def actionNew(self, action_data, id, security_limit, profile): 133 def actionNew(self, action_data, id, security_limit, profile):
133 pass 134 pass
134 135
135 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ss") 136 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
137 signature='ss')
136 def connected(self, profile, jid_s): 138 def connected(self, profile, jid_s):
137 pass 139 pass
138 140
139 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ss") 141 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
142 signature='ss')
140 def contactDeleted(self, entity_jid, profile): 143 def contactDeleted(self, entity_jid, profile):
141 pass 144 pass
142 145
143 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="s") 146 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
147 signature='s')
144 def disconnected(self, profile): 148 def disconnected(self, profile):
145 pass 149 pass
146 150
147 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ssss") 151 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
152 signature='ssss')
148 def entityDataUpdated(self, jid, name, value, profile): 153 def entityDataUpdated(self, jid, name, value, profile):
149 pass 154 pass
150 155
151 @dbus.service.signal( 156 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
152 const_INT_PREFIX + const_CORE_SUFFIX, signature="sdssa{ss}a{ss}sa{ss}s" 157 signature='sdssa{ss}a{ss}sa{ss}s')
153 ) 158 def messageNew(self, uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile):
154 def messageNew( 159 pass
155 self, 160
156 uid, 161 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
157 timestamp, 162 signature='sa{ss}ass')
158 from_jid,
159 to_jid,
160 message,
161 subject,
162 mess_type,
163 extra,
164 profile,
165 ):
166 pass
167
168 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sa{ss}ass")
169 def newContact(self, contact_jid, attributes, groups, profile): 163 def newContact(self, contact_jid, attributes, groups, profile):
170 pass 164 pass
171 165
172 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ssss") 166 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
167 signature='ssss')
173 def paramUpdate(self, name, value, category, profile): 168 def paramUpdate(self, name, value, category, profile):
174 pass 169 pass
175 170
176 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ssia{ss}s") 171 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
172 signature='ssia{ss}s')
177 def presenceUpdate(self, entity_jid, show, priority, statuses, profile): 173 def presenceUpdate(self, entity_jid, show, priority, statuses, profile):
178 pass 174 pass
179 175
180 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sss") 176 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
177 signature='sss')
181 def progressError(self, id, error, profile): 178 def progressError(self, id, error, profile):
182 pass 179 pass
183 180
184 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sa{ss}s") 181 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
182 signature='sa{ss}s')
185 def progressFinished(self, id, metadata, profile): 183 def progressFinished(self, id, metadata, profile):
186 pass 184 pass
187 185
188 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sa{ss}s") 186 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
187 signature='sa{ss}s')
189 def progressStarted(self, id, metadata, profile): 188 def progressStarted(self, id, metadata, profile):
190 pass 189 pass
191 190
192 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sss") 191 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
192 signature='sss')
193 def subscribe(self, sub_type, entity_jid, profile): 193 def subscribe(self, sub_type, entity_jid, profile):
194 pass 194 pass
195 195
196 ### methods ### 196 ### methods ###
197 197
198 @dbus.service.method( 198 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
199 const_INT_PREFIX + const_CORE_SUFFIX, 199 in_signature='s', out_signature='a(a{ss}si)',
200 in_signature="s", 200 async_callbacks=None)
201 out_signature="a(a{ss}si)",
202 async_callbacks=None,
203 )
204 def actionsGet(self, profile_key="@DEFAULT@"): 201 def actionsGet(self, profile_key="@DEFAULT@"):
205 return self._callback("actionsGet", unicode(profile_key)) 202 return self._callback("actionsGet", unicode(profile_key))
206 203
207 @dbus.service.method( 204 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
208 const_INT_PREFIX + const_CORE_SUFFIX, 205 in_signature='ss', out_signature='',
209 in_signature="ss", 206 async_callbacks=None)
210 out_signature="",
211 async_callbacks=None,
212 )
213 def addContact(self, entity_jid, profile_key="@DEFAULT@"): 207 def addContact(self, entity_jid, profile_key="@DEFAULT@"):
214 return self._callback("addContact", unicode(entity_jid), unicode(profile_key)) 208 return self._callback("addContact", unicode(entity_jid), unicode(profile_key))
215 209
216 @dbus.service.method( 210 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
217 const_INT_PREFIX + const_CORE_SUFFIX, 211 in_signature='s', out_signature='',
218 in_signature="s", 212 async_callbacks=('callback', 'errback'))
219 out_signature="",
220 async_callbacks=("callback", "errback"),
221 )
222 def asyncDeleteProfile(self, profile, callback=None, errback=None): 213 def asyncDeleteProfile(self, profile, callback=None, errback=None):
223 return self._callback( 214 return self._callback("asyncDeleteProfile", unicode(profile), callback=callback, errback=errback)
224 "asyncDeleteProfile", unicode(profile), callback=callback, errback=errback 215
225 ) 216 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
226 217 in_signature='sssis', out_signature='s',
227 @dbus.service.method( 218 async_callbacks=('callback', 'errback'))
228 const_INT_PREFIX + const_CORE_SUFFIX, 219 def asyncGetParamA(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
229 in_signature="sssis", 220 return self._callback("asyncGetParamA", unicode(name), unicode(category), unicode(attribute), security_limit, unicode(profile_key), callback=callback, errback=errback)
230 out_signature="s", 221
231 async_callbacks=("callback", "errback"), 222 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
232 ) 223 in_signature='sis', out_signature='a{ss}',
233 def asyncGetParamA( 224 async_callbacks=('callback', 'errback'))
234 self, 225 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
235 name, 226 return self._callback("asyncGetParamsValuesFromCategory", unicode(category), security_limit, unicode(profile_key), callback=callback, errback=errback)
236 category, 227
237 attribute="value", 228 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
238 security_limit=-1, 229 in_signature='ssa{ss}', out_signature='b',
239 profile_key="@DEFAULT@", 230 async_callbacks=('callback', 'errback'))
240 callback=None, 231 def connect(self, profile_key="@DEFAULT@", password='', options={}, callback=None, errback=None):
241 errback=None, 232 return self._callback("connect", unicode(profile_key), unicode(password), options, callback=callback, errback=errback)
242 ): 233
243 return self._callback( 234 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
244 "asyncGetParamA", 235 in_signature='ss', out_signature='',
245 unicode(name), 236 async_callbacks=('callback', 'errback'))
246 unicode(category), 237 def delContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
247 unicode(attribute), 238 return self._callback("delContact", unicode(entity_jid), unicode(profile_key), callback=callback, errback=errback)
248 security_limit, 239
249 unicode(profile_key), 240 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
250 callback=callback, 241 in_signature='asa(ss)bbbbbs', out_signature='(a{sa(sss)}a{sa(sss)}a{sa(sss)})',
251 errback=errback, 242 async_callbacks=('callback', 'errback'))
252 ) 243 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key=u"@DEFAULT@", callback=None, errback=None):
253 244 return self._callback("discoFindByFeatures", namespaces, identities, bare_jid, service, roster, own_jid, local_device, unicode(profile_key), callback=callback, errback=errback)
254 @dbus.service.method( 245
255 const_INT_PREFIX + const_CORE_SUFFIX, 246 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
256 in_signature="sis", 247 in_signature='ssbs', out_signature='(asa(sss)a{sa(a{ss}as)})',
257 out_signature="a{ss}", 248 async_callbacks=('callback', 'errback'))
258 async_callbacks=("callback", "errback"), 249 def discoInfos(self, entity_jid, node=u'', use_cache=True, profile_key=u"@DEFAULT@", callback=None, errback=None):
259 ) 250 return self._callback("discoInfos", unicode(entity_jid), unicode(node), use_cache, unicode(profile_key), callback=callback, errback=errback)
260 def asyncGetParamsValuesFromCategory( 251
261 self, 252 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
262 category, 253 in_signature='ssbs', out_signature='a(sss)',
263 security_limit=-1, 254 async_callbacks=('callback', 'errback'))
264 profile_key="@DEFAULT@", 255 def discoItems(self, entity_jid, node=u'', use_cache=True, profile_key=u"@DEFAULT@", callback=None, errback=None):
265 callback=None, 256 return self._callback("discoItems", unicode(entity_jid), unicode(node), use_cache, unicode(profile_key), callback=callback, errback=errback)
266 errback=None, 257
267 ): 258 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
268 return self._callback( 259 in_signature='s', out_signature='',
269 "asyncGetParamsValuesFromCategory", 260 async_callbacks=('callback', 'errback'))
270 unicode(category),
271 security_limit,
272 unicode(profile_key),
273 callback=callback,
274 errback=errback,
275 )
276
277 @dbus.service.method(
278 const_INT_PREFIX + const_CORE_SUFFIX,
279 in_signature="ssa{ss}",
280 out_signature="b",
281 async_callbacks=("callback", "errback"),
282 )
283 def connect(
284 self,
285 profile_key="@DEFAULT@",
286 password="",
287 options={},
288 callback=None,
289 errback=None,
290 ):
291 return self._callback(
292 "connect",
293 unicode(profile_key),
294 unicode(password),
295 options,
296 callback=callback,
297 errback=errback,
298 )
299
300 @dbus.service.method(
301 const_INT_PREFIX + const_CORE_SUFFIX,
302 in_signature="ss",
303 out_signature="",
304 async_callbacks=("callback", "errback"),
305 )
306 def delContact(
307 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None
308 ):
309 return self._callback(
310 "delContact",
311 unicode(entity_jid),
312 unicode(profile_key),
313 callback=callback,
314 errback=errback,
315 )
316
317 @dbus.service.method(
318 const_INT_PREFIX + const_CORE_SUFFIX,
319 in_signature="asa(ss)bbbbbs",
320 out_signature="(a{sa(sss)}a{sa(sss)}a{sa(sss)})",
321 async_callbacks=("callback", "errback"),
322 )
323 def discoFindByFeatures(
324 self,
325 namespaces,
326 identities,
327 bare_jid=False,
328 service=True,
329 roster=True,
330 own_jid=True,
331 local_device=False,
332 profile_key=u"@DEFAULT@",
333 callback=None,
334 errback=None,
335 ):
336 return self._callback(
337 "discoFindByFeatures",
338 namespaces,
339 identities,
340 bare_jid,
341 service,
342 roster,
343 own_jid,
344 local_device,
345 unicode(profile_key),
346 callback=callback,
347 errback=errback,
348 )
349
350 @dbus.service.method(
351 const_INT_PREFIX + const_CORE_SUFFIX,
352 in_signature="ssbs",
353 out_signature="(asa(sss)a{sa(a{ss}as)})",
354 async_callbacks=("callback", "errback"),
355 )
356 def discoInfos(
357 self,
358 entity_jid,
359 node=u"",
360 use_cache=True,
361 profile_key=u"@DEFAULT@",
362 callback=None,
363 errback=None,
364 ):
365 return self._callback(
366 "discoInfos",
367 unicode(entity_jid),
368 unicode(node),
369 use_cache,
370 unicode(profile_key),
371 callback=callback,
372 errback=errback,
373 )
374
375 @dbus.service.method(
376 const_INT_PREFIX + const_CORE_SUFFIX,
377 in_signature="ssbs",
378 out_signature="a(sss)",
379 async_callbacks=("callback", "errback"),
380 )
381 def discoItems(
382 self,
383 entity_jid,
384 node=u"",
385 use_cache=True,
386 profile_key=u"@DEFAULT@",
387 callback=None,
388 errback=None,
389 ):
390 return self._callback(
391 "discoItems",
392 unicode(entity_jid),
393 unicode(node),
394 use_cache,
395 unicode(profile_key),
396 callback=callback,
397 errback=errback,
398 )
399
400 @dbus.service.method(
401 const_INT_PREFIX + const_CORE_SUFFIX,
402 in_signature="s",
403 out_signature="",
404 async_callbacks=("callback", "errback"),
405 )
406 def disconnect(self, profile_key="@DEFAULT@", callback=None, errback=None): 261 def disconnect(self, profile_key="@DEFAULT@", callback=None, errback=None):
407 return self._callback( 262 return self._callback("disconnect", unicode(profile_key), callback=callback, errback=errback)
408 "disconnect", unicode(profile_key), callback=callback, errback=errback 263
409 ) 264 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
410 265 in_signature='ss', out_signature='s',
411 @dbus.service.method( 266 async_callbacks=None)
412 const_INT_PREFIX + const_CORE_SUFFIX,
413 in_signature="ss",
414 out_signature="s",
415 async_callbacks=None,
416 )
417 def getConfig(self, section, name): 267 def getConfig(self, section, name):
418 return self._callback("getConfig", unicode(section), unicode(name)) 268 return self._callback("getConfig", unicode(section), unicode(name))
419 269
420 @dbus.service.method( 270 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
421 const_INT_PREFIX + const_CORE_SUFFIX, 271 in_signature='s', out_signature='a(sa{ss}as)',
422 in_signature="s", 272 async_callbacks=('callback', 'errback'))
423 out_signature="a(sa{ss}as)",
424 async_callbacks=("callback", "errback"),
425 )
426 def getContacts(self, profile_key="@DEFAULT@", callback=None, errback=None): 273 def getContacts(self, profile_key="@DEFAULT@", callback=None, errback=None):
427 return self._callback( 274 return self._callback("getContacts", unicode(profile_key), callback=callback, errback=errback)
428 "getContacts", unicode(profile_key), callback=callback, errback=errback 275
429 ) 276 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
430 277 in_signature='ss', out_signature='as',
431 @dbus.service.method( 278 async_callbacks=None)
432 const_INT_PREFIX + const_CORE_SUFFIX,
433 in_signature="ss",
434 out_signature="as",
435 async_callbacks=None,
436 )
437 def getContactsFromGroup(self, group, profile_key="@DEFAULT@"): 279 def getContactsFromGroup(self, group, profile_key="@DEFAULT@"):
438 return self._callback( 280 return self._callback("getContactsFromGroup", unicode(group), unicode(profile_key))
439 "getContactsFromGroup", unicode(group), unicode(profile_key) 281
440 ) 282 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
441 283 in_signature='asass', out_signature='a{sa{ss}}',
442 @dbus.service.method( 284 async_callbacks=None)
443 const_INT_PREFIX + const_CORE_SUFFIX,
444 in_signature="asass",
445 out_signature="a{sa{ss}}",
446 async_callbacks=None,
447 )
448 def getEntitiesData(self, jids, keys, profile): 285 def getEntitiesData(self, jids, keys, profile):
449 return self._callback("getEntitiesData", jids, keys, unicode(profile)) 286 return self._callback("getEntitiesData", jids, keys, unicode(profile))
450 287
451 @dbus.service.method( 288 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
452 const_INT_PREFIX + const_CORE_SUFFIX, 289 in_signature='sass', out_signature='a{ss}',
453 in_signature="sass", 290 async_callbacks=None)
454 out_signature="a{ss}",
455 async_callbacks=None,
456 )
457 def getEntityData(self, jid, keys, profile): 291 def getEntityData(self, jid, keys, profile):
458 return self._callback("getEntityData", unicode(jid), keys, unicode(profile)) 292 return self._callback("getEntityData", unicode(jid), keys, unicode(profile))
459 293
460 @dbus.service.method( 294 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
461 const_INT_PREFIX + const_CORE_SUFFIX, 295 in_signature='s', out_signature='a{sa{ss}}',
462 in_signature="s", 296 async_callbacks=('callback', 'errback'))
463 out_signature="a{sa{ss}}",
464 async_callbacks=("callback", "errback"),
465 )
466 def getFeatures(self, profile_key, callback=None, errback=None): 297 def getFeatures(self, profile_key, callback=None, errback=None):
467 return self._callback( 298 return self._callback("getFeatures", unicode(profile_key), callback=callback, errback=errback)
468 "getFeatures", unicode(profile_key), callback=callback, errback=errback 299
469 ) 300 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
470 301 in_signature='ss', out_signature='s',
471 @dbus.service.method( 302 async_callbacks=None)
472 const_INT_PREFIX + const_CORE_SUFFIX,
473 in_signature="ss",
474 out_signature="s",
475 async_callbacks=None,
476 )
477 def getMainResource(self, contact_jid, profile_key="@DEFAULT@"): 303 def getMainResource(self, contact_jid, profile_key="@DEFAULT@"):
478 return self._callback( 304 return self._callback("getMainResource", unicode(contact_jid), unicode(profile_key))
479 "getMainResource", unicode(contact_jid), unicode(profile_key) 305
480 ) 306 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
481 307 in_signature='ssss', out_signature='s',
482 @dbus.service.method( 308 async_callbacks=None)
483 const_INT_PREFIX + const_CORE_SUFFIX,
484 in_signature="ssss",
485 out_signature="s",
486 async_callbacks=None,
487 )
488 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"): 309 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"):
489 return self._callback( 310 return self._callback("getParamA", unicode(name), unicode(category), unicode(attribute), unicode(profile_key))
490 "getParamA", 311
491 unicode(name), 312 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
492 unicode(category), 313 in_signature='', out_signature='as',
493 unicode(attribute), 314 async_callbacks=None)
494 unicode(profile_key), 315 def getParamsCategories(self, ):
495 ) 316 return self._callback("getParamsCategories", )
496 317
497 @dbus.service.method( 318 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
498 const_INT_PREFIX + const_CORE_SUFFIX, 319 in_signature='iss', out_signature='s',
499 in_signature="", 320 async_callbacks=('callback', 'errback'))
500 out_signature="as", 321 def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None):
501 async_callbacks=None, 322 return self._callback("getParamsUI", security_limit, unicode(app), unicode(profile_key), callback=callback, errback=errback)
502 ) 323
503 def getParamsCategories(self,): 324 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
504 return self._callback("getParamsCategories") 325 in_signature='s', out_signature='a{sa{s(sia{ss})}}',
505 326 async_callbacks=None)
506 @dbus.service.method(
507 const_INT_PREFIX + const_CORE_SUFFIX,
508 in_signature="iss",
509 out_signature="s",
510 async_callbacks=("callback", "errback"),
511 )
512 def getParamsUI(
513 self,
514 security_limit=-1,
515 app="",
516 profile_key="@DEFAULT@",
517 callback=None,
518 errback=None,
519 ):
520 return self._callback(
521 "getParamsUI",
522 security_limit,
523 unicode(app),
524 unicode(profile_key),
525 callback=callback,
526 errback=errback,
527 )
528
529 @dbus.service.method(
530 const_INT_PREFIX + const_CORE_SUFFIX,
531 in_signature="s",
532 out_signature="a{sa{s(sia{ss})}}",
533 async_callbacks=None,
534 )
535 def getPresenceStatuses(self, profile_key="@DEFAULT@"): 327 def getPresenceStatuses(self, profile_key="@DEFAULT@"):
536 return self._callback("getPresenceStatuses", unicode(profile_key)) 328 return self._callback("getPresenceStatuses", unicode(profile_key))
537 329
538 @dbus.service.method( 330 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
539 const_INT_PREFIX + const_CORE_SUFFIX, 331 in_signature='', out_signature='',
540 in_signature="", 332 async_callbacks=('callback', 'errback'))
541 out_signature="",
542 async_callbacks=("callback", "errback"),
543 )
544 def getReady(self, callback=None, errback=None): 333 def getReady(self, callback=None, errback=None):
545 return self._callback("getReady", callback=callback, errback=errback) 334 return self._callback("getReady", callback=callback, errback=errback)
546 335
547 @dbus.service.method( 336 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
548 const_INT_PREFIX + const_CORE_SUFFIX, 337 in_signature='', out_signature='s',
549 in_signature="", 338 async_callbacks=None)
550 out_signature="s", 339 def getVersion(self, ):
551 async_callbacks=None, 340 return self._callback("getVersion", )
552 ) 341
553 def getVersion(self,): 342 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
554 return self._callback("getVersion") 343 in_signature='s', out_signature='a{ss}',
555 344 async_callbacks=None)
556 @dbus.service.method(
557 const_INT_PREFIX + const_CORE_SUFFIX,
558 in_signature="s",
559 out_signature="a{ss}",
560 async_callbacks=None,
561 )
562 def getWaitingSub(self, profile_key="@DEFAULT@"): 345 def getWaitingSub(self, profile_key="@DEFAULT@"):
563 return self._callback("getWaitingSub", unicode(profile_key)) 346 return self._callback("getWaitingSub", unicode(profile_key))
564 347
565 @dbus.service.method( 348 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
566 const_INT_PREFIX + const_CORE_SUFFIX, 349 in_signature='ssiba{ss}s', out_signature='a(sdssa{ss}a{ss}sa{ss})',
567 in_signature="ssiba{ss}s", 350 async_callbacks=('callback', 'errback'))
568 out_signature="a(sdssa{ss}a{ss}sa{ss})", 351 def historyGet(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@", callback=None, errback=None):
569 async_callbacks=("callback", "errback"), 352 return self._callback("historyGet", unicode(from_jid), unicode(to_jid), limit, between, filters, unicode(profile), callback=callback, errback=errback)
570 ) 353
571 def historyGet( 354 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
572 self, 355 in_signature='s', out_signature='b',
573 from_jid, 356 async_callbacks=None)
574 to_jid,
575 limit,
576 between=True,
577 filters="",
578 profile="@NONE@",
579 callback=None,
580 errback=None,
581 ):
582 return self._callback(
583 "historyGet",
584 unicode(from_jid),
585 unicode(to_jid),
586 limit,
587 between,
588 filters,
589 unicode(profile),
590 callback=callback,
591 errback=errback,
592 )
593
594 @dbus.service.method(
595 const_INT_PREFIX + const_CORE_SUFFIX,
596 in_signature="s",
597 out_signature="b",
598 async_callbacks=None,
599 )
600 def isConnected(self, profile_key="@DEFAULT@"): 357 def isConnected(self, profile_key="@DEFAULT@"):
601 return self._callback("isConnected", unicode(profile_key)) 358 return self._callback("isConnected", unicode(profile_key))
602 359
603 @dbus.service.method( 360 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
604 const_INT_PREFIX + const_CORE_SUFFIX, 361 in_signature='sa{ss}s', out_signature='a{ss}',
605 in_signature="sa{ss}s", 362 async_callbacks=('callback', 'errback'))
606 out_signature="a{ss}", 363 def launchAction(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None):
607 async_callbacks=("callback", "errback"), 364 return self._callback("launchAction", unicode(callback_id), data, unicode(profile_key), callback=callback, errback=errback)
608 ) 365
609 def launchAction( 366 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
610 self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None 367 in_signature='s', out_signature='b',
611 ): 368 async_callbacks=None)
612 return self._callback(
613 "launchAction",
614 unicode(callback_id),
615 data,
616 unicode(profile_key),
617 callback=callback,
618 errback=errback,
619 )
620
621 @dbus.service.method(
622 const_INT_PREFIX + const_CORE_SUFFIX,
623 in_signature="s",
624 out_signature="b",
625 async_callbacks=None,
626 )
627 def loadParamsTemplate(self, filename): 369 def loadParamsTemplate(self, filename):
628 return self._callback("loadParamsTemplate", unicode(filename)) 370 return self._callback("loadParamsTemplate", unicode(filename))
629 371
630 @dbus.service.method( 372 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
631 const_INT_PREFIX + const_CORE_SUFFIX, 373 in_signature='ss', out_signature='s',
632 in_signature="ss", 374 async_callbacks=None)
633 out_signature="s",
634 async_callbacks=None,
635 )
636 def menuHelpGet(self, menu_id, language): 375 def menuHelpGet(self, menu_id, language):
637 return self._callback("menuHelpGet", unicode(menu_id), unicode(language)) 376 return self._callback("menuHelpGet", unicode(menu_id), unicode(language))
638 377
639 @dbus.service.method( 378 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
640 const_INT_PREFIX + const_CORE_SUFFIX, 379 in_signature='sasa{ss}is', out_signature='a{ss}',
641 in_signature="sasa{ss}is", 380 async_callbacks=('callback', 'errback'))
642 out_signature="a{ss}", 381 def menuLaunch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None):
643 async_callbacks=("callback", "errback"), 382 return self._callback("menuLaunch", unicode(menu_type), path, data, security_limit, unicode(profile_key), callback=callback, errback=errback)
644 ) 383
645 def menuLaunch( 384 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
646 self, 385 in_signature='si', out_signature='a(ssasasa{ss})',
647 menu_type, 386 async_callbacks=None)
648 path,
649 data,
650 security_limit,
651 profile_key,
652 callback=None,
653 errback=None,
654 ):
655 return self._callback(
656 "menuLaunch",
657 unicode(menu_type),
658 path,
659 data,
660 security_limit,
661 unicode(profile_key),
662 callback=callback,
663 errback=errback,
664 )
665
666 @dbus.service.method(
667 const_INT_PREFIX + const_CORE_SUFFIX,
668 in_signature="si",
669 out_signature="a(ssasasa{ss})",
670 async_callbacks=None,
671 )
672 def menusGet(self, language, security_limit): 387 def menusGet(self, language, security_limit):
673 return self._callback("menusGet", unicode(language), security_limit) 388 return self._callback("menusGet", unicode(language), security_limit)
674 389
675 @dbus.service.method( 390 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
676 const_INT_PREFIX + const_CORE_SUFFIX, 391 in_signature='sa{ss}a{ss}sa{ss}s', out_signature='',
677 in_signature="sa{ss}a{ss}sa{ss}s", 392 async_callbacks=('callback', 'errback'))
678 out_signature="", 393 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):
679 async_callbacks=("callback", "errback"), 394 return self._callback("messageSend", unicode(to_jid), message, subject, unicode(mess_type), extra, unicode(profile_key), callback=callback, errback=errback)
680 ) 395
681 def messageSend( 396 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
682 self, 397 in_signature='', out_signature='a{ss}',
683 to_jid, 398 async_callbacks=None)
684 message, 399 def namespacesGet(self, ):
685 subject={}, 400 return self._callback("namespacesGet", )
686 mess_type="auto", 401
687 extra={}, 402 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
688 profile_key="@NONE@", 403 in_signature='sis', out_signature='',
689 callback=None, 404 async_callbacks=None)
690 errback=None, 405 def paramsRegisterApp(self, xml, security_limit=-1, app=''):
691 ): 406 return self._callback("paramsRegisterApp", unicode(xml), security_limit, unicode(app))
692 return self._callback( 407
693 "messageSend", 408 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
694 unicode(to_jid), 409 in_signature='sss', out_signature='',
695 message, 410 async_callbacks=('callback', 'errback'))
696 subject, 411 def profileCreate(self, profile, password='', component='', callback=None, errback=None):
697 unicode(mess_type), 412 return self._callback("profileCreate", unicode(profile), unicode(password), unicode(component), callback=callback, errback=errback)
698 extra, 413
699 unicode(profile_key), 414 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
700 callback=callback, 415 in_signature='s', out_signature='b',
701 errback=errback, 416 async_callbacks=None)
702 )
703
704 @dbus.service.method(
705 const_INT_PREFIX + const_CORE_SUFFIX,
706 in_signature="",
707 out_signature="a{ss}",
708 async_callbacks=None,
709 )
710 def namespacesGet(self,):
711 return self._callback("namespacesGet")
712
713 @dbus.service.method(
714 const_INT_PREFIX + const_CORE_SUFFIX,
715 in_signature="sis",
716 out_signature="",
717 async_callbacks=None,
718 )
719 def paramsRegisterApp(self, xml, security_limit=-1, app=""):
720 return self._callback(
721 "paramsRegisterApp", unicode(xml), security_limit, unicode(app)
722 )
723
724 @dbus.service.method(
725 const_INT_PREFIX + const_CORE_SUFFIX,
726 in_signature="sss",
727 out_signature="",
728 async_callbacks=("callback", "errback"),
729 )
730 def profileCreate(
731 self, profile, password="", component="", callback=None, errback=None
732 ):
733 return self._callback(
734 "profileCreate",
735 unicode(profile),
736 unicode(password),
737 unicode(component),
738 callback=callback,
739 errback=errback,
740 )
741
742 @dbus.service.method(
743 const_INT_PREFIX + const_CORE_SUFFIX,
744 in_signature="s",
745 out_signature="b",
746 async_callbacks=None,
747 )
748 def profileIsSessionStarted(self, profile_key="@DEFAULT@"): 417 def profileIsSessionStarted(self, profile_key="@DEFAULT@"):
749 return self._callback("profileIsSessionStarted", unicode(profile_key)) 418 return self._callback("profileIsSessionStarted", unicode(profile_key))
750 419
751 @dbus.service.method( 420 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
752 const_INT_PREFIX + const_CORE_SUFFIX, 421 in_signature='s', out_signature='s',
753 in_signature="s", 422 async_callbacks=None)
754 out_signature="s",
755 async_callbacks=None,
756 )
757 def profileNameGet(self, profile_key="@DEFAULT@"): 423 def profileNameGet(self, profile_key="@DEFAULT@"):
758 return self._callback("profileNameGet", unicode(profile_key)) 424 return self._callback("profileNameGet", unicode(profile_key))
759 425
760 @dbus.service.method( 426 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
761 const_INT_PREFIX + const_CORE_SUFFIX, 427 in_signature='s', out_signature='',
762 in_signature="s", 428 async_callbacks=None)
763 out_signature="",
764 async_callbacks=None,
765 )
766 def profileSetDefault(self, profile): 429 def profileSetDefault(self, profile):
767 return self._callback("profileSetDefault", unicode(profile)) 430 return self._callback("profileSetDefault", unicode(profile))
768 431
769 @dbus.service.method( 432 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
770 const_INT_PREFIX + const_CORE_SUFFIX, 433 in_signature='ss', out_signature='b',
771 in_signature="ss", 434 async_callbacks=('callback', 'errback'))
772 out_signature="b", 435 def profileStartSession(self, password='', profile_key="@DEFAULT@", callback=None, errback=None):
773 async_callbacks=("callback", "errback"), 436 return self._callback("profileStartSession", unicode(password), unicode(profile_key), callback=callback, errback=errback)
774 ) 437
775 def profileStartSession( 438 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
776 self, password="", profile_key="@DEFAULT@", callback=None, errback=None 439 in_signature='bb', out_signature='as',
777 ): 440 async_callbacks=None)
778 return self._callback(
779 "profileStartSession",
780 unicode(password),
781 unicode(profile_key),
782 callback=callback,
783 errback=errback,
784 )
785
786 @dbus.service.method(
787 const_INT_PREFIX + const_CORE_SUFFIX,
788 in_signature="bb",
789 out_signature="as",
790 async_callbacks=None,
791 )
792 def profilesListGet(self, clients=True, components=False): 441 def profilesListGet(self, clients=True, components=False):
793 return self._callback("profilesListGet", clients, components) 442 return self._callback("profilesListGet", clients, components)
794 443
795 @dbus.service.method( 444 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
796 const_INT_PREFIX + const_CORE_SUFFIX, 445 in_signature='ss', out_signature='a{ss}',
797 in_signature="ss", 446 async_callbacks=None)
798 out_signature="a{ss}",
799 async_callbacks=None,
800 )
801 def progressGet(self, id, profile): 447 def progressGet(self, id, profile):
802 return self._callback("progressGet", unicode(id), unicode(profile)) 448 return self._callback("progressGet", unicode(id), unicode(profile))
803 449
804 @dbus.service.method( 450 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
805 const_INT_PREFIX + const_CORE_SUFFIX, 451 in_signature='s', out_signature='a{sa{sa{ss}}}',
806 in_signature="s", 452 async_callbacks=None)
807 out_signature="a{sa{sa{ss}}}",
808 async_callbacks=None,
809 )
810 def progressGetAll(self, profile): 453 def progressGetAll(self, profile):
811 return self._callback("progressGetAll", unicode(profile)) 454 return self._callback("progressGetAll", unicode(profile))
812 455
813 @dbus.service.method( 456 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
814 const_INT_PREFIX + const_CORE_SUFFIX, 457 in_signature='s', out_signature='a{sa{sa{ss}}}',
815 in_signature="s", 458 async_callbacks=None)
816 out_signature="a{sa{sa{ss}}}",
817 async_callbacks=None,
818 )
819 def progressGetAllMetadata(self, profile): 459 def progressGetAllMetadata(self, profile):
820 return self._callback("progressGetAllMetadata", unicode(profile)) 460 return self._callback("progressGetAllMetadata", unicode(profile))
821 461
822 @dbus.service.method( 462 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
823 const_INT_PREFIX + const_CORE_SUFFIX, 463 in_signature='s', out_signature='b',
824 in_signature="s", 464 async_callbacks=None)
825 out_signature="b",
826 async_callbacks=None,
827 )
828 def saveParamsTemplate(self, filename): 465 def saveParamsTemplate(self, filename):
829 return self._callback("saveParamsTemplate", unicode(filename)) 466 return self._callback("saveParamsTemplate", unicode(filename))
830 467
831 @dbus.service.method( 468 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
832 const_INT_PREFIX + const_CORE_SUFFIX, 469 in_signature='s', out_signature='a{ss}',
833 in_signature="s", 470 async_callbacks=('callback', 'errback'))
834 out_signature="a{ss}",
835 async_callbacks=("callback", "errback"),
836 )
837 def sessionInfosGet(self, profile_key, callback=None, errback=None): 471 def sessionInfosGet(self, profile_key, callback=None, errback=None):
838 return self._callback( 472 return self._callback("sessionInfosGet", unicode(profile_key), callback=callback, errback=errback)
839 "sessionInfosGet", unicode(profile_key), callback=callback, errback=errback 473
840 ) 474 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
841 475 in_signature='sssis', out_signature='',
842 @dbus.service.method( 476 async_callbacks=None)
843 const_INT_PREFIX + const_CORE_SUFFIX,
844 in_signature="sssis",
845 out_signature="",
846 async_callbacks=None,
847 )
848 def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"): 477 def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"):
849 return self._callback( 478 return self._callback("setParam", unicode(name), unicode(value), unicode(category), security_limit, unicode(profile_key))
850 "setParam", 479
851 unicode(name), 480 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
852 unicode(value), 481 in_signature='ssa{ss}s', out_signature='',
853 unicode(category), 482 async_callbacks=None)
854 security_limit, 483 def setPresence(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@"):
855 unicode(profile_key), 484 return self._callback("setPresence", unicode(to_jid), unicode(show), statuses, unicode(profile_key))
856 ) 485
857 486 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
858 @dbus.service.method( 487 in_signature='sss', out_signature='',
859 const_INT_PREFIX + const_CORE_SUFFIX, 488 async_callbacks=None)
860 in_signature="ssa{ss}s",
861 out_signature="",
862 async_callbacks=None,
863 )
864 def setPresence(self, to_jid="", show="", statuses={}, profile_key="@DEFAULT@"):
865 return self._callback(
866 "setPresence", unicode(to_jid), unicode(show), statuses, unicode(profile_key)
867 )
868
869 @dbus.service.method(
870 const_INT_PREFIX + const_CORE_SUFFIX,
871 in_signature="sss",
872 out_signature="",
873 async_callbacks=None,
874 )
875 def subscription(self, sub_type, entity, profile_key="@DEFAULT@"): 489 def subscription(self, sub_type, entity, profile_key="@DEFAULT@"):
876 return self._callback( 490 return self._callback("subscription", unicode(sub_type), unicode(entity), unicode(profile_key))
877 "subscription", unicode(sub_type), unicode(entity), unicode(profile_key) 491
878 ) 492 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
879 493 in_signature='ssass', out_signature='',
880 @dbus.service.method( 494 async_callbacks=('callback', 'errback'))
881 const_INT_PREFIX + const_CORE_SUFFIX, 495 def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@", callback=None, errback=None):
882 in_signature="ssass", 496 return self._callback("updateContact", unicode(entity_jid), unicode(name), groups, unicode(profile_key), callback=callback, errback=errback)
883 out_signature="",
884 async_callbacks=("callback", "errback"),
885 )
886 def updateContact(
887 self,
888 entity_jid,
889 name,
890 groups,
891 profile_key="@DEFAULT@",
892 callback=None,
893 errback=None,
894 ):
895 return self._callback(
896 "updateContact",
897 unicode(entity_jid),
898 unicode(name),
899 groups,
900 unicode(profile_key),
901 callback=callback,
902 errback=errback,
903 )
904 497
905 def __attributes(self, in_sign): 498 def __attributes(self, in_sign):
906 """Return arguments to user given a in_sign 499 """Return arguments to user given a in_sign
907 @param in_sign: in_sign in the short form (using s,a,i,b etc) 500 @param in_sign: in_sign in the short form (using s,a,i,b etc)
908 @return: list of arguments that correspond to a in_sign (e.g.: "sss" return "arg1, arg2, arg3")""" 501 @return: list of arguments that correspond to a in_sign (e.g.: "sss" return "arg1, arg2, arg3")"""
1055 self.dbus_bridge.disconnected(profile) 648 self.dbus_bridge.disconnected(profile)
1056 649
1057 def entityDataUpdated(self, jid, name, value, profile): 650 def entityDataUpdated(self, jid, name, value, profile):
1058 self.dbus_bridge.entityDataUpdated(jid, name, value, profile) 651 self.dbus_bridge.entityDataUpdated(jid, name, value, profile)
1059 652
1060 def messageNew( 653 def messageNew(self, uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile):
1061 self, 654 self.dbus_bridge.messageNew(uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile)
1062 uid,
1063 timestamp,
1064 from_jid,
1065 to_jid,
1066 message,
1067 subject,
1068 mess_type,
1069 extra,
1070 profile,
1071 ):
1072 self.dbus_bridge.messageNew(
1073 uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile
1074 )
1075 655
1076 def newContact(self, contact_jid, attributes, groups, profile): 656 def newContact(self, contact_jid, attributes, groups, profile):
1077 self.dbus_bridge.newContact(contact_jid, attributes, groups, profile) 657 self.dbus_bridge.newContact(contact_jid, attributes, groups, profile)
1078 658
1079 def paramUpdate(self, name, value, category, profile): 659 def paramUpdate(self, name, value, category, profile):