comparison libervia/frontends/bridge/pb.py @ 4284:3a550e9a2b55

black reformatting
author Goffi <goffi@goffi.org>
date Sun, 14 Jul 2024 16:47:45 +0200
parents 4cf98f506269
children
comparison
equal deleted inserted replaced
4283:23842a63ea00 4284:3a550e9a2b55
159 return d 159 return d
160 160
161 def register_signal(self, functionName, handler, iface="core"): 161 def register_signal(self, functionName, handler, iface="core"):
162 self.signals_handler.register_signal(functionName, handler, iface) 162 self.signals_handler.register_signal(functionName, handler, iface)
163 163
164 164 def action_launch(
165 def action_launch(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None): 165 self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None
166 ):
166 d = self.root.callRemote("action_launch", callback_id, data, profile_key) 167 d = self.root.callRemote("action_launch", callback_id, data, profile_key)
167 if callback is not None: 168 if callback is not None:
168 d.addCallback(callback) 169 d.addCallback(callback)
169 if errback is None: 170 if errback is None:
170 d.addErrback(self._generic_errback) 171 d.addErrback(self._generic_errback)
187 if errback is None: 188 if errback is None:
188 d.addErrback(self._generic_errback) 189 d.addErrback(self._generic_errback)
189 else: 190 else:
190 d.addErrback(self._errback, ori_errback=errback) 191 d.addErrback(self._errback, ori_errback=errback)
191 192
192 def connect(self, profile_key="@DEFAULT@", password='', options={}, callback=None, errback=None): 193 def connect(
194 self,
195 profile_key="@DEFAULT@",
196 password="",
197 options={},
198 callback=None,
199 errback=None,
200 ):
193 d = self.root.callRemote("connect", profile_key, password, options) 201 d = self.root.callRemote("connect", profile_key, password, options)
194 if callback is not None: 202 if callback is not None:
195 d.addCallback(callback) 203 d.addCallback(callback)
196 if errback is None: 204 if errback is None:
197 d.addErrback(self._generic_errback) 205 d.addErrback(self._generic_errback)
198 else: 206 else:
199 d.addErrback(self._errback, ori_errback=errback) 207 d.addErrback(self._errback, ori_errback=errback)
200 208
201 def contact_add(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None): 209 def contact_add(
210 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None
211 ):
202 d = self.root.callRemote("contact_add", entity_jid, profile_key) 212 d = self.root.callRemote("contact_add", entity_jid, profile_key)
203 if callback is not None: 213 if callback is not None:
204 d.addCallback(lambda __: callback()) 214 d.addCallback(lambda __: callback())
205 if errback is None: 215 if errback is None:
206 d.addErrback(self._generic_errback) 216 d.addErrback(self._generic_errback)
207 else: 217 else:
208 d.addErrback(self._errback, ori_errback=errback) 218 d.addErrback(self._errback, ori_errback=errback)
209 219
210 def contact_del(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None): 220 def contact_del(
221 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None
222 ):
211 d = self.root.callRemote("contact_del", entity_jid, profile_key) 223 d = self.root.callRemote("contact_del", entity_jid, profile_key)
212 if callback is not None: 224 if callback is not None:
213 d.addCallback(lambda __: callback()) 225 d.addCallback(lambda __: callback())
214 if errback is None: 226 if errback is None:
215 d.addErrback(self._generic_errback) 227 d.addErrback(self._generic_errback)
223 if errback is None: 235 if errback is None:
224 d.addErrback(self._generic_errback) 236 d.addErrback(self._generic_errback)
225 else: 237 else:
226 d.addErrback(self._errback, ori_errback=errback) 238 d.addErrback(self._errback, ori_errback=errback)
227 239
228 def contact_update(self, entity_jid, name, groups, profile_key="@DEFAULT@", callback=None, errback=None): 240 def contact_update(
241 self,
242 entity_jid,
243 name,
244 groups,
245 profile_key="@DEFAULT@",
246 callback=None,
247 errback=None,
248 ):
229 d = self.root.callRemote("contact_update", entity_jid, name, groups, profile_key) 249 d = self.root.callRemote("contact_update", entity_jid, name, groups, profile_key)
230 if callback is not None: 250 if callback is not None:
231 d.addCallback(lambda __: callback()) 251 d.addCallback(lambda __: callback())
232 if errback is None: 252 if errback is None:
233 d.addErrback(self._generic_errback) 253 d.addErrback(self._generic_errback)
241 if errback is None: 261 if errback is None:
242 d.addErrback(self._generic_errback) 262 d.addErrback(self._generic_errback)
243 else: 263 else:
244 d.addErrback(self._errback, ori_errback=errback) 264 d.addErrback(self._errback, ori_errback=errback)
245 265
246 def contacts_get_from_group(self, group, profile_key="@DEFAULT@", callback=None, errback=None): 266 def contacts_get_from_group(
267 self, group, profile_key="@DEFAULT@", callback=None, errback=None
268 ):
247 d = self.root.callRemote("contacts_get_from_group", group, profile_key) 269 d = self.root.callRemote("contacts_get_from_group", group, profile_key)
248 if callback is not None: 270 if callback is not None:
249 d.addCallback(callback) 271 d.addCallback(callback)
250 if errback is None: 272 if errback is None:
251 d.addErrback(self._generic_errback) 273 d.addErrback(self._generic_errback)
259 if errback is None: 281 if errback is None:
260 d.addErrback(self._generic_errback) 282 d.addErrback(self._generic_errback)
261 else: 283 else:
262 d.addErrback(self._errback, ori_errback=errback) 284 d.addErrback(self._errback, ori_errback=errback)
263 285
264 def disco_find_by_features(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@", callback=None, errback=None): 286 def disco_find_by_features(
265 d = self.root.callRemote("disco_find_by_features", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key) 287 self,
266 if callback is not None: 288 namespaces,
267 d.addCallback(callback) 289 identities,
268 if errback is None: 290 bare_jid=False,
269 d.addErrback(self._generic_errback) 291 service=True,
270 else: 292 roster=True,
271 d.addErrback(self._errback, ori_errback=errback) 293 own_jid=True,
272 294 local_device=False,
273 def disco_infos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None): 295 profile_key="@DEFAULT@",
296 callback=None,
297 errback=None,
298 ):
299 d = self.root.callRemote(
300 "disco_find_by_features",
301 namespaces,
302 identities,
303 bare_jid,
304 service,
305 roster,
306 own_jid,
307 local_device,
308 profile_key,
309 )
310 if callback is not None:
311 d.addCallback(callback)
312 if errback is None:
313 d.addErrback(self._generic_errback)
314 else:
315 d.addErrback(self._errback, ori_errback=errback)
316
317 def disco_infos(
318 self,
319 entity_jid,
320 node="",
321 use_cache=True,
322 profile_key="@DEFAULT@",
323 callback=None,
324 errback=None,
325 ):
274 d = self.root.callRemote("disco_infos", entity_jid, node, use_cache, profile_key) 326 d = self.root.callRemote("disco_infos", entity_jid, node, use_cache, profile_key)
275 if callback is not None: 327 if callback is not None:
276 d.addCallback(callback) 328 d.addCallback(callback)
277 if errback is None: 329 if errback is None:
278 d.addErrback(self._generic_errback) 330 d.addErrback(self._generic_errback)
279 else: 331 else:
280 d.addErrback(self._errback, ori_errback=errback) 332 d.addErrback(self._errback, ori_errback=errback)
281 333
282 def disco_items(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None): 334 def disco_items(
335 self,
336 entity_jid,
337 node="",
338 use_cache=True,
339 profile_key="@DEFAULT@",
340 callback=None,
341 errback=None,
342 ):
283 d = self.root.callRemote("disco_items", entity_jid, node, use_cache, profile_key) 343 d = self.root.callRemote("disco_items", entity_jid, node, use_cache, profile_key)
284 if callback is not None: 344 if callback is not None:
285 d.addCallback(callback) 345 d.addCallback(callback)
286 if errback is None: 346 if errback is None:
287 d.addErrback(self._generic_errback) 347 d.addErrback(self._generic_errback)
313 if errback is None: 373 if errback is None:
314 d.addErrback(self._generic_errback) 374 d.addErrback(self._generic_errback)
315 else: 375 else:
316 d.addErrback(self._errback, ori_errback=errback) 376 d.addErrback(self._errback, ori_errback=errback)
317 377
318 def encryption_trust_ui_get(self, to_jid, namespace, profile_key, callback=None, errback=None): 378 def encryption_trust_ui_get(
319 d = self.root.callRemote("encryption_trust_ui_get", to_jid, namespace, profile_key) 379 self, to_jid, namespace, profile_key, callback=None, errback=None
380 ):
381 d = self.root.callRemote(
382 "encryption_trust_ui_get", to_jid, namespace, profile_key
383 )
320 if callback is not None: 384 if callback is not None:
321 d.addCallback(callback) 385 d.addCallback(callback)
322 if errback is None: 386 if errback is None:
323 d.addErrback(self._generic_errback) 387 d.addErrback(self._generic_errback)
324 else: 388 else:
349 if errback is None: 413 if errback is None:
350 d.addErrback(self._generic_errback) 414 d.addErrback(self._generic_errback)
351 else: 415 else:
352 d.addErrback(self._errback, ori_errback=errback) 416 d.addErrback(self._errback, ori_errback=errback)
353 417
354 def history_get(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@", callback=None, errback=None): 418 def history_get(
355 d = self.root.callRemote("history_get", from_jid, to_jid, limit, between, filters, profile) 419 self,
420 from_jid,
421 to_jid,
422 limit,
423 between=True,
424 filters="",
425 profile="@NONE@",
426 callback=None,
427 errback=None,
428 ):
429 d = self.root.callRemote(
430 "history_get", from_jid, to_jid, limit, between, filters, profile
431 )
356 if callback is not None: 432 if callback is not None:
357 d.addCallback(callback) 433 d.addCallback(callback)
358 if errback is None: 434 if errback is None:
359 d.addErrback(self._generic_errback) 435 d.addErrback(self._generic_errback)
360 else: 436 else:
376 if errback is None: 452 if errback is None:
377 d.addErrback(self._generic_errback) 453 d.addErrback(self._generic_errback)
378 else: 454 else:
379 d.addErrback(self._errback, ori_errback=errback) 455 d.addErrback(self._errback, ori_errback=errback)
380 456
381 def image_generate_preview(self, image_path, profile_key, callback=None, errback=None): 457 def image_generate_preview(
458 self, image_path, profile_key, callback=None, errback=None
459 ):
382 d = self.root.callRemote("image_generate_preview", image_path, profile_key) 460 d = self.root.callRemote("image_generate_preview", image_path, profile_key)
383 if callback is not None: 461 if callback is not None:
384 d.addCallback(callback) 462 d.addCallback(callback)
385 if errback is None: 463 if errback is None:
386 d.addErrback(self._generic_errback) 464 d.addErrback(self._generic_errback)
412 if errback is None: 490 if errback is None:
413 d.addErrback(self._generic_errback) 491 d.addErrback(self._generic_errback)
414 else: 492 else:
415 d.addErrback(self._errback, ori_errback=errback) 493 d.addErrback(self._errback, ori_errback=errback)
416 494
417 def main_resource_get(self, contact_jid, profile_key="@DEFAULT@", callback=None, errback=None): 495 def main_resource_get(
496 self, contact_jid, profile_key="@DEFAULT@", callback=None, errback=None
497 ):
418 d = self.root.callRemote("main_resource_get", contact_jid, profile_key) 498 d = self.root.callRemote("main_resource_get", contact_jid, profile_key)
419 if callback is not None: 499 if callback is not None:
420 d.addCallback(callback) 500 d.addCallback(callback)
421 if errback is None: 501 if errback is None:
422 d.addErrback(self._generic_errback) 502 d.addErrback(self._generic_errback)
430 if errback is None: 510 if errback is None:
431 d.addErrback(self._generic_errback) 511 d.addErrback(self._generic_errback)
432 else: 512 else:
433 d.addErrback(self._errback, ori_errback=errback) 513 d.addErrback(self._errback, ori_errback=errback)
434 514
435 def menu_launch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None): 515 def menu_launch(
436 d = self.root.callRemote("menu_launch", menu_type, path, data, security_limit, profile_key) 516 self,
517 menu_type,
518 path,
519 data,
520 security_limit,
521 profile_key,
522 callback=None,
523 errback=None,
524 ):
525 d = self.root.callRemote(
526 "menu_launch", menu_type, path, data, security_limit, profile_key
527 )
437 if callback is not None: 528 if callback is not None:
438 d.addCallback(callback) 529 d.addCallback(callback)
439 if errback is None: 530 if errback is None:
440 d.addErrback(self._generic_errback) 531 d.addErrback(self._generic_errback)
441 else: 532 else:
457 if errback is None: 548 if errback is None:
458 d.addErrback(self._generic_errback) 549 d.addErrback(self._generic_errback)
459 else: 550 else:
460 d.addErrback(self._errback, ori_errback=errback) 551 d.addErrback(self._errback, ori_errback=errback)
461 552
462 def message_encryption_start(self, to_jid, namespace='', replace=False, profile_key="@NONE@", callback=None, errback=None): 553 def message_encryption_start(
463 d = self.root.callRemote("message_encryption_start", to_jid, namespace, replace, profile_key) 554 self,
555 to_jid,
556 namespace="",
557 replace=False,
558 profile_key="@NONE@",
559 callback=None,
560 errback=None,
561 ):
562 d = self.root.callRemote(
563 "message_encryption_start", to_jid, namespace, replace, profile_key
564 )
464 if callback is not None: 565 if callback is not None:
465 d.addCallback(lambda __: callback()) 566 d.addCallback(lambda __: callback())
466 if errback is None: 567 if errback is None:
467 d.addErrback(self._generic_errback) 568 d.addErrback(self._generic_errback)
468 else: 569 else:
475 if errback is None: 576 if errback is None:
476 d.addErrback(self._generic_errback) 577 d.addErrback(self._generic_errback)
477 else: 578 else:
478 d.addErrback(self._errback, ori_errback=errback) 579 d.addErrback(self._errback, ori_errback=errback)
479 580
480 def message_send(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None): 581 def message_send(
481 d = self.root.callRemote("message_send", to_jid, message, subject, mess_type, extra, profile_key) 582 self,
583 to_jid,
584 message,
585 subject={},
586 mess_type="auto",
587 extra={},
588 profile_key="@NONE@",
589 callback=None,
590 errback=None,
591 ):
592 d = self.root.callRemote(
593 "message_send", to_jid, message, subject, mess_type, extra, profile_key
594 )
482 if callback is not None: 595 if callback is not None:
483 d.addCallback(lambda __: callback()) 596 d.addCallback(lambda __: callback())
484 if errback is None: 597 if errback is None:
485 d.addErrback(self._generic_errback) 598 d.addErrback(self._generic_errback)
486 else: 599 else:
493 if errback is None: 606 if errback is None:
494 d.addErrback(self._generic_errback) 607 d.addErrback(self._generic_errback)
495 else: 608 else:
496 d.addErrback(self._errback, ori_errback=errback) 609 d.addErrback(self._errback, ori_errback=errback)
497 610
498 def notification_add(self, type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra, callback=None, errback=None): 611 def notification_add(
499 d = self.root.callRemote("notification_add", type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra) 612 self,
500 if callback is not None: 613 type_,
501 d.addCallback(lambda __: callback()) 614 body_plain,
502 if errback is None: 615 body_rich,
503 d.addErrback(self._generic_errback) 616 title,
504 else: 617 is_global,
505 d.addErrback(self._errback, ori_errback=errback) 618 requires_action,
506 619 arg_6,
507 def notification_delete(self, id_, is_global, profile_key, callback=None, errback=None): 620 priority,
621 expire_at,
622 extra,
623 callback=None,
624 errback=None,
625 ):
626 d = self.root.callRemote(
627 "notification_add",
628 type_,
629 body_plain,
630 body_rich,
631 title,
632 is_global,
633 requires_action,
634 arg_6,
635 priority,
636 expire_at,
637 extra,
638 )
639 if callback is not None:
640 d.addCallback(lambda __: callback())
641 if errback is None:
642 d.addErrback(self._generic_errback)
643 else:
644 d.addErrback(self._errback, ori_errback=errback)
645
646 def notification_delete(
647 self, id_, is_global, profile_key, callback=None, errback=None
648 ):
508 d = self.root.callRemote("notification_delete", id_, is_global, profile_key) 649 d = self.root.callRemote("notification_delete", id_, is_global, profile_key)
509 if callback is not None: 650 if callback is not None:
510 d.addCallback(lambda __: callback()) 651 d.addCallback(lambda __: callback())
511 if errback is None: 652 if errback is None:
512 d.addErrback(self._generic_errback) 653 d.addErrback(self._generic_errback)
513 else: 654 else:
514 d.addErrback(self._errback, ori_errback=errback) 655 d.addErrback(self._errback, ori_errback=errback)
515 656
516 def notifications_expired_clean(self, limit_timestamp, profile_key, callback=None, errback=None): 657 def notifications_expired_clean(
517 d = self.root.callRemote("notifications_expired_clean", limit_timestamp, profile_key) 658 self, limit_timestamp, profile_key, callback=None, errback=None
659 ):
660 d = self.root.callRemote(
661 "notifications_expired_clean", limit_timestamp, profile_key
662 )
518 if callback is not None: 663 if callback is not None:
519 d.addCallback(lambda __: callback()) 664 d.addCallback(lambda __: callback())
520 if errback is None: 665 if errback is None:
521 d.addErrback(self._generic_errback) 666 d.addErrback(self._generic_errback)
522 else: 667 else:
529 if errback is None: 674 if errback is None:
530 d.addErrback(self._generic_errback) 675 d.addErrback(self._generic_errback)
531 else: 676 else:
532 d.addErrback(self._errback, ori_errback=errback) 677 d.addErrback(self._errback, ori_errback=errback)
533 678
534 def param_get_a(self, name, category, attribute="value", profile_key="@DEFAULT@", callback=None, errback=None): 679 def param_get_a(
680 self,
681 name,
682 category,
683 attribute="value",
684 profile_key="@DEFAULT@",
685 callback=None,
686 errback=None,
687 ):
535 d = self.root.callRemote("param_get_a", name, category, attribute, profile_key) 688 d = self.root.callRemote("param_get_a", name, category, attribute, profile_key)
536 if callback is not None: 689 if callback is not None:
537 d.addCallback(callback) 690 d.addCallback(callback)
538 if errback is None: 691 if errback is None:
539 d.addErrback(self._generic_errback) 692 d.addErrback(self._generic_errback)
540 else: 693 else:
541 d.addErrback(self._errback, ori_errback=errback) 694 d.addErrback(self._errback, ori_errback=errback)
542 695
543 def param_get_a_async(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None): 696 def param_get_a_async(
544 d = self.root.callRemote("param_get_a_async", name, category, attribute, security_limit, profile_key) 697 self,
545 if callback is not None: 698 name,
546 d.addCallback(callback) 699 category,
547 if errback is None: 700 attribute="value",
548 d.addErrback(self._generic_errback) 701 security_limit=-1,
549 else: 702 profile_key="@DEFAULT@",
550 d.addErrback(self._errback, ori_errback=errback) 703 callback=None,
551 704 errback=None,
552 def param_set(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None): 705 ):
553 d = self.root.callRemote("param_set", name, value, category, security_limit, profile_key) 706 d = self.root.callRemote(
554 if callback is not None: 707 "param_get_a_async", name, category, attribute, security_limit, profile_key
555 d.addCallback(lambda __: callback()) 708 )
556 if errback is None: 709 if callback is not None:
557 d.addErrback(self._generic_errback) 710 d.addCallback(callback)
558 else: 711 if errback is None:
559 d.addErrback(self._errback, ori_errback=errback) 712 d.addErrback(self._generic_errback)
560 713 else:
561 def param_ui_get(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@", callback=None, errback=None): 714 d.addErrback(self._errback, ori_errback=errback)
715
716 def param_set(
717 self,
718 name,
719 value,
720 category,
721 security_limit=-1,
722 profile_key="@DEFAULT@",
723 callback=None,
724 errback=None,
725 ):
726 d = self.root.callRemote(
727 "param_set", name, value, category, security_limit, profile_key
728 )
729 if callback is not None:
730 d.addCallback(lambda __: callback())
731 if errback is None:
732 d.addErrback(self._generic_errback)
733 else:
734 d.addErrback(self._errback, ori_errback=errback)
735
736 def param_ui_get(
737 self,
738 security_limit=-1,
739 app="",
740 extra="",
741 profile_key="@DEFAULT@",
742 callback=None,
743 errback=None,
744 ):
562 d = self.root.callRemote("param_ui_get", security_limit, app, extra, profile_key) 745 d = self.root.callRemote("param_ui_get", security_limit, app, extra, profile_key)
563 if callback is not None: 746 if callback is not None:
564 d.addCallback(callback) 747 d.addCallback(callback)
565 if errback is None: 748 if errback is None:
566 d.addErrback(self._generic_errback) 749 d.addErrback(self._generic_errback)
574 if errback is None: 757 if errback is None:
575 d.addErrback(self._generic_errback) 758 d.addErrback(self._generic_errback)
576 else: 759 else:
577 d.addErrback(self._errback, ori_errback=errback) 760 d.addErrback(self._errback, ori_errback=errback)
578 761
579 def params_register_app(self, xml, security_limit=-1, app='', callback=None, errback=None): 762 def params_register_app(
763 self, xml, security_limit=-1, app="", callback=None, errback=None
764 ):
580 d = self.root.callRemote("params_register_app", xml, security_limit, app) 765 d = self.root.callRemote("params_register_app", xml, security_limit, app)
581 if callback is not None: 766 if callback is not None:
582 d.addCallback(lambda __: callback()) 767 d.addCallback(lambda __: callback())
583 if errback is None: 768 if errback is None:
584 d.addErrback(self._generic_errback) 769 d.addErrback(self._generic_errback)
601 if errback is None: 786 if errback is None:
602 d.addErrback(self._generic_errback) 787 d.addErrback(self._generic_errback)
603 else: 788 else:
604 d.addErrback(self._errback, ori_errback=errback) 789 d.addErrback(self._errback, ori_errback=errback)
605 790
606 def params_values_from_category_get_async(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@", callback=None, errback=None): 791 def params_values_from_category_get_async(
607 d = self.root.callRemote("params_values_from_category_get_async", category, security_limit, app, extra, profile_key) 792 self,
608 if callback is not None: 793 category,
609 d.addCallback(callback) 794 security_limit=-1,
610 if errback is None: 795 app="",
611 d.addErrback(self._generic_errback) 796 extra="",
612 else: 797 profile_key="@DEFAULT@",
613 d.addErrback(self._errback, ori_errback=errback) 798 callback=None,
614 799 errback=None,
615 def presence_set(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@", callback=None, errback=None): 800 ):
801 d = self.root.callRemote(
802 "params_values_from_category_get_async",
803 category,
804 security_limit,
805 app,
806 extra,
807 profile_key,
808 )
809 if callback is not None:
810 d.addCallback(callback)
811 if errback is None:
812 d.addErrback(self._generic_errback)
813 else:
814 d.addErrback(self._errback, ori_errback=errback)
815
816 def presence_set(
817 self,
818 to_jid="",
819 show="",
820 statuses={},
821 profile_key="@DEFAULT@",
822 callback=None,
823 errback=None,
824 ):
616 d = self.root.callRemote("presence_set", to_jid, show, statuses, profile_key) 825 d = self.root.callRemote("presence_set", to_jid, show, statuses, profile_key)
617 if callback is not None: 826 if callback is not None:
618 d.addCallback(lambda __: callback()) 827 d.addCallback(lambda __: callback())
619 if errback is None: 828 if errback is None:
620 d.addErrback(self._generic_errback) 829 d.addErrback(self._generic_errback)
646 if errback is None: 855 if errback is None:
647 d.addErrback(self._generic_errback) 856 d.addErrback(self._generic_errback)
648 else: 857 else:
649 d.addErrback(self._errback, ori_errback=errback) 858 d.addErrback(self._errback, ori_errback=errback)
650 859
651 def private_data_set(self, namespace, key, data, profile_key, callback=None, errback=None): 860 def private_data_set(
861 self, namespace, key, data, profile_key, callback=None, errback=None
862 ):
652 d = self.root.callRemote("private_data_set", namespace, key, data, profile_key) 863 d = self.root.callRemote("private_data_set", namespace, key, data, profile_key)
653 if callback is not None: 864 if callback is not None:
654 d.addCallback(lambda __: callback()) 865 d.addCallback(lambda __: callback())
655 if errback is None: 866 if errback is None:
656 d.addErrback(self._generic_errback) 867 d.addErrback(self._generic_errback)
657 else: 868 else:
658 d.addErrback(self._errback, ori_errback=errback) 869 d.addErrback(self._errback, ori_errback=errback)
659 870
660 def profile_create(self, profile, password='', component='', callback=None, errback=None): 871 def profile_create(
872 self, profile, password="", component="", callback=None, errback=None
873 ):
661 d = self.root.callRemote("profile_create", profile, password, component) 874 d = self.root.callRemote("profile_create", profile, password, component)
662 if callback is not None: 875 if callback is not None:
663 d.addCallback(lambda __: callback()) 876 d.addCallback(lambda __: callback())
664 if errback is None: 877 if errback is None:
665 d.addErrback(self._generic_errback) 878 d.addErrback(self._generic_errback)
673 if errback is None: 886 if errback is None:
674 d.addErrback(self._generic_errback) 887 d.addErrback(self._generic_errback)
675 else: 888 else:
676 d.addErrback(self._errback, ori_errback=errback) 889 d.addErrback(self._errback, ori_errback=errback)
677 890
678 def profile_is_session_started(self, profile_key="@DEFAULT@", callback=None, errback=None): 891 def profile_is_session_started(
892 self, profile_key="@DEFAULT@", callback=None, errback=None
893 ):
679 d = self.root.callRemote("profile_is_session_started", profile_key) 894 d = self.root.callRemote("profile_is_session_started", profile_key)
680 if callback is not None: 895 if callback is not None:
681 d.addCallback(callback) 896 d.addCallback(callback)
682 if errback is None: 897 if errback is None:
683 d.addErrback(self._generic_errback) 898 d.addErrback(self._generic_errback)
700 if errback is None: 915 if errback is None:
701 d.addErrback(self._generic_errback) 916 d.addErrback(self._generic_errback)
702 else: 917 else:
703 d.addErrback(self._errback, ori_errback=errback) 918 d.addErrback(self._errback, ori_errback=errback)
704 919
705 def profile_start_session(self, password='', profile_key="@DEFAULT@", callback=None, errback=None): 920 def profile_start_session(
921 self, password="", profile_key="@DEFAULT@", callback=None, errback=None
922 ):
706 d = self.root.callRemote("profile_start_session", password, profile_key) 923 d = self.root.callRemote("profile_start_session", password, profile_key)
707 if callback is not None: 924 if callback is not None:
708 d.addCallback(callback) 925 d.addCallback(callback)
709 if errback is None: 926 if errback is None:
710 d.addErrback(self._generic_errback) 927 d.addErrback(self._generic_errback)
711 else: 928 else:
712 d.addErrback(self._errback, ori_errback=errback) 929 d.addErrback(self._errback, ori_errback=errback)
713 930
714 def profiles_list_get(self, clients=True, components=False, callback=None, errback=None): 931 def profiles_list_get(
932 self, clients=True, components=False, callback=None, errback=None
933 ):
715 d = self.root.callRemote("profiles_list_get", clients, components) 934 d = self.root.callRemote("profiles_list_get", clients, components)
716 if callback is not None: 935 if callback is not None:
717 d.addCallback(callback) 936 d.addCallback(callback)
718 if errback is None: 937 if errback is None:
719 d.addErrback(self._generic_errback) 938 d.addErrback(self._generic_errback)
781 if errback is None: 1000 if errback is None:
782 d.addErrback(self._generic_errback) 1001 d.addErrback(self._generic_errback)
783 else: 1002 else:
784 d.addErrback(self._errback, ori_errback=errback) 1003 d.addErrback(self._errback, ori_errback=errback)
785 1004
786 def subscription(self, sub_type, entity, profile_key="@DEFAULT@", callback=None, errback=None): 1005 def subscription(
1006 self, sub_type, entity, profile_key="@DEFAULT@", callback=None, errback=None
1007 ):
787 d = self.root.callRemote("subscription", sub_type, entity, profile_key) 1008 d = self.root.callRemote("subscription", sub_type, entity, profile_key)
788 if callback is not None: 1009 if callback is not None:
789 d.addCallback(lambda __: callback()) 1010 d.addCallback(lambda __: callback())
790 if errback is None: 1011 if errback is None:
791 d.addErrback(self._generic_errback) 1012 d.addErrback(self._generic_errback)
798 d.addCallback(callback) 1019 d.addCallback(callback)
799 if errback is None: 1020 if errback is None:
800 d.addErrback(self._generic_errback) 1021 d.addErrback(self._generic_errback)
801 else: 1022 else:
802 d.addErrback(self._errback, ori_errback=errback) 1023 d.addErrback(self._errback, ori_errback=errback)
803
804 1024
805 1025
806 class AIOSignalsHandler(SignalsHandler): 1026 class AIOSignalsHandler(SignalsHandler):
807 1027
808 def register_signal(self, name, handler, iface="core"): 1028 def register_signal(self, name, handler, iface="core"):
830 1050
831 async def bridge_connect(self): 1051 async def bridge_connect(self):
832 d = super().bridge_connect(callback=None, errback=None) 1052 d = super().bridge_connect(callback=None, errback=None)
833 return await d.asFuture(asyncio.get_event_loop()) 1053 return await d.asFuture(asyncio.get_event_loop())
834 1054
835
836 def action_launch(self, callback_id, data, profile_key="@DEFAULT@"): 1055 def action_launch(self, callback_id, data, profile_key="@DEFAULT@"):
837 d = self.root.callRemote("action_launch", callback_id, data, profile_key) 1056 d = self.root.callRemote("action_launch", callback_id, data, profile_key)
838 d.addErrback(self._errback) 1057 d.addErrback(self._errback)
839 return d.asFuture(asyncio.get_event_loop()) 1058 return d.asFuture(asyncio.get_event_loop())
840 1059
846 def config_get(self, section, name): 1065 def config_get(self, section, name):
847 d = self.root.callRemote("config_get", section, name) 1066 d = self.root.callRemote("config_get", section, name)
848 d.addErrback(self._errback) 1067 d.addErrback(self._errback)
849 return d.asFuture(asyncio.get_event_loop()) 1068 return d.asFuture(asyncio.get_event_loop())
850 1069
851 def connect(self, profile_key="@DEFAULT@", password='', options={}): 1070 def connect(self, profile_key="@DEFAULT@", password="", options={}):
852 d = self.root.callRemote("connect", profile_key, password, options) 1071 d = self.root.callRemote("connect", profile_key, password, options)
853 d.addErrback(self._errback) 1072 d.addErrback(self._errback)
854 return d.asFuture(asyncio.get_event_loop()) 1073 return d.asFuture(asyncio.get_event_loop())
855 1074
856 def contact_add(self, entity_jid, profile_key="@DEFAULT@"): 1075 def contact_add(self, entity_jid, profile_key="@DEFAULT@"):
886 def devices_infos_get(self, bare_jid, profile_key): 1105 def devices_infos_get(self, bare_jid, profile_key):
887 d = self.root.callRemote("devices_infos_get", bare_jid, profile_key) 1106 d = self.root.callRemote("devices_infos_get", bare_jid, profile_key)
888 d.addErrback(self._errback) 1107 d.addErrback(self._errback)
889 return d.asFuture(asyncio.get_event_loop()) 1108 return d.asFuture(asyncio.get_event_loop())
890 1109
891 def disco_find_by_features(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@"): 1110 def disco_find_by_features(
892 d = self.root.callRemote("disco_find_by_features", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key) 1111 self,
893 d.addErrback(self._errback) 1112 namespaces,
894 return d.asFuture(asyncio.get_event_loop()) 1113 identities,
895 1114 bare_jid=False,
896 def disco_infos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"): 1115 service=True,
1116 roster=True,
1117 own_jid=True,
1118 local_device=False,
1119 profile_key="@DEFAULT@",
1120 ):
1121 d = self.root.callRemote(
1122 "disco_find_by_features",
1123 namespaces,
1124 identities,
1125 bare_jid,
1126 service,
1127 roster,
1128 own_jid,
1129 local_device,
1130 profile_key,
1131 )
1132 d.addErrback(self._errback)
1133 return d.asFuture(asyncio.get_event_loop())
1134
1135 def disco_infos(self, entity_jid, node="", use_cache=True, profile_key="@DEFAULT@"):
897 d = self.root.callRemote("disco_infos", entity_jid, node, use_cache, profile_key) 1136 d = self.root.callRemote("disco_infos", entity_jid, node, use_cache, profile_key)
898 d.addErrback(self._errback) 1137 d.addErrback(self._errback)
899 return d.asFuture(asyncio.get_event_loop()) 1138 return d.asFuture(asyncio.get_event_loop())
900 1139
901 def disco_items(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"): 1140 def disco_items(self, entity_jid, node="", use_cache=True, profile_key="@DEFAULT@"):
902 d = self.root.callRemote("disco_items", entity_jid, node, use_cache, profile_key) 1141 d = self.root.callRemote("disco_items", entity_jid, node, use_cache, profile_key)
903 d.addErrback(self._errback) 1142 d.addErrback(self._errback)
904 return d.asFuture(asyncio.get_event_loop()) 1143 return d.asFuture(asyncio.get_event_loop())
905 1144
906 def disconnect(self, profile_key="@DEFAULT@"): 1145 def disconnect(self, profile_key="@DEFAULT@"):
917 d = self.root.callRemote("encryption_plugins_get") 1156 d = self.root.callRemote("encryption_plugins_get")
918 d.addErrback(self._errback) 1157 d.addErrback(self._errback)
919 return d.asFuture(asyncio.get_event_loop()) 1158 return d.asFuture(asyncio.get_event_loop())
920 1159
921 def encryption_trust_ui_get(self, to_jid, namespace, profile_key): 1160 def encryption_trust_ui_get(self, to_jid, namespace, profile_key):
922 d = self.root.callRemote("encryption_trust_ui_get", to_jid, namespace, profile_key) 1161 d = self.root.callRemote(
1162 "encryption_trust_ui_get", to_jid, namespace, profile_key
1163 )
923 d.addErrback(self._errback) 1164 d.addErrback(self._errback)
924 return d.asFuture(asyncio.get_event_loop()) 1165 return d.asFuture(asyncio.get_event_loop())
925 1166
926 def entities_data_get(self, jids, keys, profile): 1167 def entities_data_get(self, jids, keys, profile):
927 d = self.root.callRemote("entities_data_get", jids, keys, profile) 1168 d = self.root.callRemote("entities_data_get", jids, keys, profile)
936 def features_get(self, profile_key): 1177 def features_get(self, profile_key):
937 d = self.root.callRemote("features_get", profile_key) 1178 d = self.root.callRemote("features_get", profile_key)
938 d.addErrback(self._errback) 1179 d.addErrback(self._errback)
939 return d.asFuture(asyncio.get_event_loop()) 1180 return d.asFuture(asyncio.get_event_loop())
940 1181
941 def history_get(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@"): 1182 def history_get(
942 d = self.root.callRemote("history_get", from_jid, to_jid, limit, between, filters, profile) 1183 self, from_jid, to_jid, limit, between=True, filters="", profile="@NONE@"
1184 ):
1185 d = self.root.callRemote(
1186 "history_get", from_jid, to_jid, limit, between, filters, profile
1187 )
943 d.addErrback(self._errback) 1188 d.addErrback(self._errback)
944 return d.asFuture(asyncio.get_event_loop()) 1189 return d.asFuture(asyncio.get_event_loop())
945 1190
946 def image_check(self, arg_0): 1191 def image_check(self, arg_0):
947 d = self.root.callRemote("image_check", arg_0) 1192 d = self.root.callRemote("image_check", arg_0)
982 d = self.root.callRemote("menu_help_get", menu_id, language) 1227 d = self.root.callRemote("menu_help_get", menu_id, language)
983 d.addErrback(self._errback) 1228 d.addErrback(self._errback)
984 return d.asFuture(asyncio.get_event_loop()) 1229 return d.asFuture(asyncio.get_event_loop())
985 1230
986 def menu_launch(self, menu_type, path, data, security_limit, profile_key): 1231 def menu_launch(self, menu_type, path, data, security_limit, profile_key):
987 d = self.root.callRemote("menu_launch", menu_type, path, data, security_limit, profile_key) 1232 d = self.root.callRemote(
1233 "menu_launch", menu_type, path, data, security_limit, profile_key
1234 )
988 d.addErrback(self._errback) 1235 d.addErrback(self._errback)
989 return d.asFuture(asyncio.get_event_loop()) 1236 return d.asFuture(asyncio.get_event_loop())
990 1237
991 def menus_get(self, language, security_limit): 1238 def menus_get(self, language, security_limit):
992 d = self.root.callRemote("menus_get", language, security_limit) 1239 d = self.root.callRemote("menus_get", language, security_limit)
996 def message_encryption_get(self, to_jid, profile_key): 1243 def message_encryption_get(self, to_jid, profile_key):
997 d = self.root.callRemote("message_encryption_get", to_jid, profile_key) 1244 d = self.root.callRemote("message_encryption_get", to_jid, profile_key)
998 d.addErrback(self._errback) 1245 d.addErrback(self._errback)
999 return d.asFuture(asyncio.get_event_loop()) 1246 return d.asFuture(asyncio.get_event_loop())
1000 1247
1001 def message_encryption_start(self, to_jid, namespace='', replace=False, profile_key="@NONE@"): 1248 def message_encryption_start(
1002 d = self.root.callRemote("message_encryption_start", to_jid, namespace, replace, profile_key) 1249 self, to_jid, namespace="", replace=False, profile_key="@NONE@"
1250 ):
1251 d = self.root.callRemote(
1252 "message_encryption_start", to_jid, namespace, replace, profile_key
1253 )
1003 d.addErrback(self._errback) 1254 d.addErrback(self._errback)
1004 return d.asFuture(asyncio.get_event_loop()) 1255 return d.asFuture(asyncio.get_event_loop())
1005 1256
1006 def message_encryption_stop(self, to_jid, profile_key): 1257 def message_encryption_stop(self, to_jid, profile_key):
1007 d = self.root.callRemote("message_encryption_stop", to_jid, profile_key) 1258 d = self.root.callRemote("message_encryption_stop", to_jid, profile_key)
1008 d.addErrback(self._errback) 1259 d.addErrback(self._errback)
1009 return d.asFuture(asyncio.get_event_loop()) 1260 return d.asFuture(asyncio.get_event_loop())
1010 1261
1011 def message_send(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@"): 1262 def message_send(
1012 d = self.root.callRemote("message_send", to_jid, message, subject, mess_type, extra, profile_key) 1263 self,
1264 to_jid,
1265 message,
1266 subject={},
1267 mess_type="auto",
1268 extra={},
1269 profile_key="@NONE@",
1270 ):
1271 d = self.root.callRemote(
1272 "message_send", to_jid, message, subject, mess_type, extra, profile_key
1273 )
1013 d.addErrback(self._errback) 1274 d.addErrback(self._errback)
1014 return d.asFuture(asyncio.get_event_loop()) 1275 return d.asFuture(asyncio.get_event_loop())
1015 1276
1016 def namespaces_get(self): 1277 def namespaces_get(self):
1017 d = self.root.callRemote("namespaces_get") 1278 d = self.root.callRemote("namespaces_get")
1018 d.addErrback(self._errback) 1279 d.addErrback(self._errback)
1019 return d.asFuture(asyncio.get_event_loop()) 1280 return d.asFuture(asyncio.get_event_loop())
1020 1281
1021 def notification_add(self, type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra): 1282 def notification_add(
1022 d = self.root.callRemote("notification_add", type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra) 1283 self,
1284 type_,
1285 body_plain,
1286 body_rich,
1287 title,
1288 is_global,
1289 requires_action,
1290 arg_6,
1291 priority,
1292 expire_at,
1293 extra,
1294 ):
1295 d = self.root.callRemote(
1296 "notification_add",
1297 type_,
1298 body_plain,
1299 body_rich,
1300 title,
1301 is_global,
1302 requires_action,
1303 arg_6,
1304 priority,
1305 expire_at,
1306 extra,
1307 )
1023 d.addErrback(self._errback) 1308 d.addErrback(self._errback)
1024 return d.asFuture(asyncio.get_event_loop()) 1309 return d.asFuture(asyncio.get_event_loop())
1025 1310
1026 def notification_delete(self, id_, is_global, profile_key): 1311 def notification_delete(self, id_, is_global, profile_key):
1027 d = self.root.callRemote("notification_delete", id_, is_global, profile_key) 1312 d = self.root.callRemote("notification_delete", id_, is_global, profile_key)
1028 d.addErrback(self._errback) 1313 d.addErrback(self._errback)
1029 return d.asFuture(asyncio.get_event_loop()) 1314 return d.asFuture(asyncio.get_event_loop())
1030 1315
1031 def notifications_expired_clean(self, limit_timestamp, profile_key): 1316 def notifications_expired_clean(self, limit_timestamp, profile_key):
1032 d = self.root.callRemote("notifications_expired_clean", limit_timestamp, profile_key) 1317 d = self.root.callRemote(
1318 "notifications_expired_clean", limit_timestamp, profile_key
1319 )
1033 d.addErrback(self._errback) 1320 d.addErrback(self._errback)
1034 return d.asFuture(asyncio.get_event_loop()) 1321 return d.asFuture(asyncio.get_event_loop())
1035 1322
1036 def notifications_get(self, filters, profile_key): 1323 def notifications_get(self, filters, profile_key):
1037 d = self.root.callRemote("notifications_get", filters, profile_key) 1324 d = self.root.callRemote("notifications_get", filters, profile_key)
1041 def param_get_a(self, name, category, attribute="value", profile_key="@DEFAULT@"): 1328 def param_get_a(self, name, category, attribute="value", profile_key="@DEFAULT@"):
1042 d = self.root.callRemote("param_get_a", name, category, attribute, profile_key) 1329 d = self.root.callRemote("param_get_a", name, category, attribute, profile_key)
1043 d.addErrback(self._errback) 1330 d.addErrback(self._errback)
1044 return d.asFuture(asyncio.get_event_loop()) 1331 return d.asFuture(asyncio.get_event_loop())
1045 1332
1046 def param_get_a_async(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@"): 1333 def param_get_a_async(
1047 d = self.root.callRemote("param_get_a_async", name, category, attribute, security_limit, profile_key) 1334 self,
1048 d.addErrback(self._errback) 1335 name,
1049 return d.asFuture(asyncio.get_event_loop()) 1336 category,
1050 1337 attribute="value",
1051 def param_set(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"): 1338 security_limit=-1,
1052 d = self.root.callRemote("param_set", name, value, category, security_limit, profile_key) 1339 profile_key="@DEFAULT@",
1053 d.addErrback(self._errback) 1340 ):
1054 return d.asFuture(asyncio.get_event_loop()) 1341 d = self.root.callRemote(
1055 1342 "param_get_a_async", name, category, attribute, security_limit, profile_key
1056 def param_ui_get(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@"): 1343 )
1344 d.addErrback(self._errback)
1345 return d.asFuture(asyncio.get_event_loop())
1346
1347 def param_set(
1348 self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"
1349 ):
1350 d = self.root.callRemote(
1351 "param_set", name, value, category, security_limit, profile_key
1352 )
1353 d.addErrback(self._errback)
1354 return d.asFuture(asyncio.get_event_loop())
1355
1356 def param_ui_get(self, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"):
1057 d = self.root.callRemote("param_ui_get", security_limit, app, extra, profile_key) 1357 d = self.root.callRemote("param_ui_get", security_limit, app, extra, profile_key)
1058 d.addErrback(self._errback) 1358 d.addErrback(self._errback)
1059 return d.asFuture(asyncio.get_event_loop()) 1359 return d.asFuture(asyncio.get_event_loop())
1060 1360
1061 def params_categories_get(self): 1361 def params_categories_get(self):
1062 d = self.root.callRemote("params_categories_get") 1362 d = self.root.callRemote("params_categories_get")
1063 d.addErrback(self._errback) 1363 d.addErrback(self._errback)
1064 return d.asFuture(asyncio.get_event_loop()) 1364 return d.asFuture(asyncio.get_event_loop())
1065 1365
1066 def params_register_app(self, xml, security_limit=-1, app=''): 1366 def params_register_app(self, xml, security_limit=-1, app=""):
1067 d = self.root.callRemote("params_register_app", xml, security_limit, app) 1367 d = self.root.callRemote("params_register_app", xml, security_limit, app)
1068 d.addErrback(self._errback) 1368 d.addErrback(self._errback)
1069 return d.asFuture(asyncio.get_event_loop()) 1369 return d.asFuture(asyncio.get_event_loop())
1070 1370
1071 def params_template_load(self, filename): 1371 def params_template_load(self, filename):
1076 def params_template_save(self, filename): 1376 def params_template_save(self, filename):
1077 d = self.root.callRemote("params_template_save", filename) 1377 d = self.root.callRemote("params_template_save", filename)
1078 d.addErrback(self._errback) 1378 d.addErrback(self._errback)
1079 return d.asFuture(asyncio.get_event_loop()) 1379 return d.asFuture(asyncio.get_event_loop())
1080 1380
1081 def params_values_from_category_get_async(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"): 1381 def params_values_from_category_get_async(
1082 d = self.root.callRemote("params_values_from_category_get_async", category, security_limit, app, extra, profile_key) 1382 self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"
1083 d.addErrback(self._errback) 1383 ):
1084 return d.asFuture(asyncio.get_event_loop()) 1384 d = self.root.callRemote(
1085 1385 "params_values_from_category_get_async",
1086 def presence_set(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@"): 1386 category,
1387 security_limit,
1388 app,
1389 extra,
1390 profile_key,
1391 )
1392 d.addErrback(self._errback)
1393 return d.asFuture(asyncio.get_event_loop())
1394
1395 def presence_set(self, to_jid="", show="", statuses={}, profile_key="@DEFAULT@"):
1087 d = self.root.callRemote("presence_set", to_jid, show, statuses, profile_key) 1396 d = self.root.callRemote("presence_set", to_jid, show, statuses, profile_key)
1088 d.addErrback(self._errback) 1397 d.addErrback(self._errback)
1089 return d.asFuture(asyncio.get_event_loop()) 1398 return d.asFuture(asyncio.get_event_loop())
1090 1399
1091 def presence_statuses_get(self, profile_key="@DEFAULT@"): 1400 def presence_statuses_get(self, profile_key="@DEFAULT@"):
1106 def private_data_set(self, namespace, key, data, profile_key): 1415 def private_data_set(self, namespace, key, data, profile_key):
1107 d = self.root.callRemote("private_data_set", namespace, key, data, profile_key) 1416 d = self.root.callRemote("private_data_set", namespace, key, data, profile_key)
1108 d.addErrback(self._errback) 1417 d.addErrback(self._errback)
1109 return d.asFuture(asyncio.get_event_loop()) 1418 return d.asFuture(asyncio.get_event_loop())
1110 1419
1111 def profile_create(self, profile, password='', component=''): 1420 def profile_create(self, profile, password="", component=""):
1112 d = self.root.callRemote("profile_create", profile, password, component) 1421 d = self.root.callRemote("profile_create", profile, password, component)
1113 d.addErrback(self._errback) 1422 d.addErrback(self._errback)
1114 return d.asFuture(asyncio.get_event_loop()) 1423 return d.asFuture(asyncio.get_event_loop())
1115 1424
1116 def profile_delete_async(self, profile): 1425 def profile_delete_async(self, profile):
1131 def profile_set_default(self, profile): 1440 def profile_set_default(self, profile):
1132 d = self.root.callRemote("profile_set_default", profile) 1441 d = self.root.callRemote("profile_set_default", profile)
1133 d.addErrback(self._errback) 1442 d.addErrback(self._errback)
1134 return d.asFuture(asyncio.get_event_loop()) 1443 return d.asFuture(asyncio.get_event_loop())
1135 1444
1136 def profile_start_session(self, password='', profile_key="@DEFAULT@"): 1445 def profile_start_session(self, password="", profile_key="@DEFAULT@"):
1137 d = self.root.callRemote("profile_start_session", password, profile_key) 1446 d = self.root.callRemote("profile_start_session", password, profile_key)
1138 d.addErrback(self._errback) 1447 d.addErrback(self._errback)
1139 return d.asFuture(asyncio.get_event_loop()) 1448 return d.asFuture(asyncio.get_event_loop())
1140 1449
1141 def profiles_list_get(self, clients=True, components=False): 1450 def profiles_list_get(self, clients=True, components=False):