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