Mercurial > libervia-backend
annotate libervia/frontends/bridge/pb.py @ 4295:7d98d894933c
frontends (tools/aio): Fix excessive use of CPU:
Use a short delay instead of `loop.call_soonloop.call_soon` when work as been done, as
this was resulting in an excessive use of CPU.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 06 Sep 2024 17:38:31 +0200 |
parents | 3a550e9a2b55 |
children |
rev | line source |
---|---|
3028 | 1 #!/usr/bin/env python3 |
3137 | 2 |
3254
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
3 # SàT communication bridge |
3479 | 4 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
5 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 # This program is free software: you can redistribute it and/or modify |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
7 # it under the terms of the GNU Affero General Public License as published by |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
8 # the Free Software Foundation, either version 3 of the License, or |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
9 # (at your option) any later version. |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
10 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
14 # GNU Affero General Public License for more details. |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
15 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
16 # You should have received a copy of the GNU Affero General Public License |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
18 |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
19 import asyncio |
3489
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
20 from logging import getLogger |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
21 from functools import partial |
3489
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
22 from pathlib import Path |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
23 from twisted.spread import pb |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
24 from twisted.internet import reactor, defer |
3489
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
25 from twisted.internet.error import ConnectionRefusedError, ConnectError |
4071
4b842c1fb686
refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents:
4037
diff
changeset
|
26 from libervia.backend.core import exceptions |
4b842c1fb686
refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents:
4037
diff
changeset
|
27 from libervia.backend.tools import config |
4074
26b7ed2817da
refactoring: rename `sat_frontends` to `libervia.frontends`
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
28 from libervia.frontends.bridge.bridge_frontend import BridgeException |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
29 |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
30 log = getLogger(__name__) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
31 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
32 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
33 class SignalsHandler(pb.Referenceable): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
34 def __getattr__(self, name): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
35 if name.startswith("remote_"): |
3028 | 36 log.debug("calling an unregistered signal: {name}".format(name=name[7:])) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
37 return lambda *args, **kwargs: None |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
38 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
39 else: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
40 raise AttributeError(name) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
41 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
42 def register_signal(self, name, handler, iface="core"): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
43 log.debug("registering signal {name}".format(name=name)) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
44 method_name = "remote_" + name |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
45 try: |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
46 self.__getattribute__(method_name) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
47 except AttributeError: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
48 pass |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
49 else: |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
50 raise exceptions.InternalError( |
4270
0d7bb4df2343
Reformatted code base using black.
Goffi <goffi@goffi.org>
parents:
4193
diff
changeset
|
51 "{name} signal handler has been registered twice".format(name=method_name) |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
52 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
53 setattr(self, method_name, handler) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
54 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
55 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
56 class bridge(object): |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
57 |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
58 def __init__(self): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
59 self.signals_handler = SignalsHandler() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
60 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
61 def __getattr__(self, name): |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
62 return partial(self.call, name) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
63 |
3063
84bb63e1e4c4
bridge (pb): added missing _generic_errback
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
64 def _generic_errback(self, err): |
84bb63e1e4c4
bridge (pb): added missing _generic_errback
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
65 log.error(f"bridge error: {err}") |
84bb63e1e4c4
bridge (pb): added missing _generic_errback
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
66 |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
67 def _errback(self, failure_, ori_errback): |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
68 """Convert Failure to BridgeException""" |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
69 ori_errback( |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
70 BridgeException( |
4270
0d7bb4df2343
Reformatted code base using black.
Goffi <goffi@goffi.org>
parents:
4193
diff
changeset
|
71 name=failure_.type.decode("utf-8"), message=str(failure_.value) |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
72 ) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
73 ) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
74 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
75 def remote_callback(self, result, callback): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
76 """call callback with argument or None |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
77 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
78 if result is not None not argument is used, |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
79 else result is used as argument |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
80 @param result: remote call result |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
81 @param callback(callable): method to call on result |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
82 """ |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
83 if result is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
84 callback() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
85 else: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
86 callback(result) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
87 |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
88 def call(self, name, *args, **kwargs): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
89 """call a remote method |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
90 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
91 @param name(str): name of the bridge method |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
92 @param args(list): arguments |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
93 may contain callback and errback as last 2 items |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
94 @param kwargs(dict): keyword arguments |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
95 may contain callback and errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
96 """ |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
97 callback = errback = None |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
98 if kwargs: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
99 try: |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
100 callback = kwargs.pop("callback") |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
101 except KeyError: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
102 pass |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
103 try: |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
104 errback = kwargs.pop("errback") |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
105 except KeyError: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
106 pass |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
107 elif len(args) >= 2 and callable(args[-1]) and callable(args[-2]): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
108 errback = args.pop() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
109 callback = args.pop() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
110 d = self.root.callRemote(name, *args, **kwargs) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
111 if callback is not None: |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
112 d.addCallback(self.remote_callback, callback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
113 if errback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
114 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
115 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
116 def _init_bridge_eb(self, failure_): |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
117 log.error("Can't init bridge: {msg}".format(msg=failure_)) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
118 return failure_ |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
119 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
120 def _set_root(self, root): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
121 """set remote root object |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
122 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
123 bridge will then be initialised |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
124 """ |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
125 self.root = root |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
126 d = root.callRemote("initBridge", self.signals_handler) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
127 d.addErrback(self._init_bridge_eb) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
128 return d |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
129 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
130 def get_root_object_eb(self, failure_): |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
131 """Call errback with appropriate bridge error""" |
3489
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
132 if failure_.check(ConnectionRefusedError, ConnectError): |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
133 raise exceptions.BridgeExceptionNoService |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
134 else: |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
135 raise failure_ |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
136 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
137 def bridge_connect(self, callback, errback): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
138 factory = pb.PBClientFactory() |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
139 conf = config.parse_main_conf() |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
140 get_conf = partial(config.get_conf, conf, "bridge_pb", "") |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
141 conn_type = get_conf("connection_type", "unix_socket") |
3489
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
142 if conn_type == "unix_socket": |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
143 local_dir = Path(config.config_get(conf, "", "local_dir")).resolve() |
3489
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
144 socket_path = local_dir / "bridge_pb" |
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
145 reactor.connectUNIX(str(socket_path), factory) |
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
146 elif conn_type == "socket": |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
147 host = get_conf("host", "localhost") |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
148 port = int(get_conf("port", 8789)) |
3489
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
149 reactor.connectTCP(host, port, factory) |
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
150 else: |
d71a163c0861
bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents:
3479
diff
changeset
|
151 raise ValueError(f"Unknown pb connection type: {conn_type!r}") |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
152 d = factory.getRootObject() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
153 d.addCallback(self._set_root) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
154 if callback is not None: |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
155 d.addCallback(lambda __: callback()) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
156 d.addErrback(self.get_root_object_eb) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
157 if errback is not None: |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
158 d.addErrback(lambda failure_: errback(failure_.value)) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
159 return d |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
160 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
161 def register_signal(self, functionName, handler, iface="core"): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
162 self.signals_handler.register_signal(functionName, handler, iface) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
163 |
4284 | 164 def action_launch( |
165 self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None | |
166 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
167 d = self.root.callRemote("action_launch", callback_id, data, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
168 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
169 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
170 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
171 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
172 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
173 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
174 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
175 def actions_get(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
176 d = self.root.callRemote("actions_get", profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
177 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
178 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
179 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
180 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
181 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
182 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
183 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
184 def config_get(self, section, name, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
185 d = self.root.callRemote("config_get", section, name) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
186 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
187 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
188 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
189 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
190 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
191 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
192 |
4284 | 193 def connect( |
194 self, | |
195 profile_key="@DEFAULT@", | |
196 password="", | |
197 options={}, | |
198 callback=None, | |
199 errback=None, | |
200 ): | |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
201 d = self.root.callRemote("connect", profile_key, password, options) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
202 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
203 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
204 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
205 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
206 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
207 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
208 |
4284 | 209 def contact_add( |
210 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None | |
211 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
212 d = self.root.callRemote("contact_add", entity_jid, profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
213 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
214 d.addCallback(lambda __: callback()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
215 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
216 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
217 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
218 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
219 |
4284 | 220 def contact_del( |
221 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None | |
222 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
223 d = self.root.callRemote("contact_del", entity_jid, profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
224 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
225 d.addCallback(lambda __: callback()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
226 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
227 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
228 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
229 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
230 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
231 def contact_get(self, arg_0, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
232 d = self.root.callRemote("contact_get", arg_0, profile_key) |
3254
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
233 if callback is not None: |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
234 d.addCallback(callback) |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
235 if errback is None: |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
236 d.addErrback(self._generic_errback) |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
237 else: |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
238 d.addErrback(self._errback, ori_errback=errback) |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
239 |
4284 | 240 def contact_update( |
241 self, | |
242 entity_jid, | |
243 name, | |
244 groups, | |
245 profile_key="@DEFAULT@", | |
246 callback=None, | |
247 errback=None, | |
248 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
249 d = self.root.callRemote("contact_update", entity_jid, name, groups, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
250 if callback is not None: |
2765
378188abe941
misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
Goffi <goffi@goffi.org>
parents:
2733
diff
changeset
|
251 d.addCallback(lambda __: callback()) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
252 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
253 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
254 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
255 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
256 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
257 def contacts_get(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
258 d = self.root.callRemote("contacts_get", profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
259 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
260 d.addCallback(callback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
261 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
262 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
263 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
264 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
265 |
4284 | 266 def contacts_get_from_group( |
267 self, group, profile_key="@DEFAULT@", callback=None, errback=None | |
268 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
269 d = self.root.callRemote("contacts_get_from_group", group, profile_key) |
3206
ae09989e9feb
core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents:
3201
diff
changeset
|
270 if callback is not None: |
ae09989e9feb
core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents:
3201
diff
changeset
|
271 d.addCallback(callback) |
ae09989e9feb
core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents:
3201
diff
changeset
|
272 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
273 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
274 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
275 d.addErrback(self._errback, ori_errback=errback) |
3206
ae09989e9feb
core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents:
3201
diff
changeset
|
276 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
277 def devices_infos_get(self, bare_jid, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
278 d = self.root.callRemote("devices_infos_get", bare_jid, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
279 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
280 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
281 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
282 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
283 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
284 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
285 |
4284 | 286 def disco_find_by_features( |
287 self, | |
288 namespaces, | |
289 identities, | |
290 bare_jid=False, | |
291 service=True, | |
292 roster=True, | |
293 own_jid=True, | |
294 local_device=False, | |
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 ) | |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
310 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
311 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
312 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
313 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
314 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
315 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
316 |
4284 | 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 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
326 d = self.root.callRemote("disco_infos", entity_jid, node, use_cache, profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
327 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
328 d.addCallback(callback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
329 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
330 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
331 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
332 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
333 |
4284 | 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 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
343 d = self.root.callRemote("disco_items", entity_jid, node, use_cache, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
344 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
345 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
346 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
347 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
348 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
349 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
350 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
351 def disconnect(self, profile_key="@DEFAULT@", callback=None, errback=None): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
352 d = self.root.callRemote("disconnect", profile_key) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
353 if callback is not None: |
2765
378188abe941
misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
Goffi <goffi@goffi.org>
parents:
2733
diff
changeset
|
354 d.addCallback(lambda __: callback()) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
355 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
356 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
357 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
358 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
359 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
360 def encryption_namespace_get(self, arg_0, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
361 d = self.root.callRemote("encryption_namespace_get", arg_0) |
2733
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
362 if callback is not None: |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
363 d.addCallback(callback) |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
364 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
365 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
366 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
367 d.addErrback(self._errback, ori_errback=errback) |
2733
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
368 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
369 def encryption_plugins_get(self, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
370 d = self.root.callRemote("encryption_plugins_get") |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
371 if callback is not None: |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
372 d.addCallback(callback) |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
373 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
374 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
375 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
376 d.addErrback(self._errback, ori_errback=errback) |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
377 |
4284 | 378 def encryption_trust_ui_get( |
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 ) | |
2733
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
384 if callback is not None: |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
385 d.addCallback(callback) |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
386 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
387 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
388 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
389 d.addErrback(self._errback, ori_errback=errback) |
2733
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
390 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
391 def entities_data_get(self, jids, keys, profile, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
392 d = self.root.callRemote("entities_data_get", jids, keys, profile) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
393 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
394 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
395 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
396 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
397 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
398 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
399 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
400 def entity_data_get(self, jid, keys, profile, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
401 d = self.root.callRemote("entity_data_get", jid, keys, profile) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
402 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
403 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
404 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
405 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
406 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
407 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
408 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
409 def features_get(self, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
410 d = self.root.callRemote("features_get", profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
411 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
412 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
413 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
414 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
415 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
416 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
417 |
4284 | 418 def history_get( |
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 ) | |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
432 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
433 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
434 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
435 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
436 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
437 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
438 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
439 def image_check(self, arg_0, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
440 d = self.root.callRemote("image_check", arg_0) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
441 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
442 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
443 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
444 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
445 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
446 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
447 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
448 def image_convert(self, source, dest, arg_2, extra, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
449 d = self.root.callRemote("image_convert", source, dest, arg_2, extra) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
450 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
451 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
452 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
453 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
454 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
455 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
456 |
4284 | 457 def image_generate_preview( |
458 self, image_path, profile_key, callback=None, errback=None | |
459 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
460 d = self.root.callRemote("image_generate_preview", image_path, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
461 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
462 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
463 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
464 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
465 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
466 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
467 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
468 def image_resize(self, image_path, width, height, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
469 d = self.root.callRemote("image_resize", image_path, width, height) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
470 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
471 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
472 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
473 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
474 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
475 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
476 |
4193
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
477 def init_pre_script(self, callback=None, errback=None): |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
478 d = self.root.callRemote("init_pre_script") |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
479 if callback is not None: |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
480 d.addCallback(lambda __: callback()) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
481 if errback is None: |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
482 d.addErrback(self._generic_errback) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
483 else: |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
484 d.addErrback(self._errback, ori_errback=errback) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
485 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
486 def is_connected(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
487 d = self.root.callRemote("is_connected", profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
488 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
489 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
490 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
491 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
492 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
493 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
494 |
4284 | 495 def main_resource_get( |
496 self, contact_jid, profile_key="@DEFAULT@", callback=None, errback=None | |
497 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
498 d = self.root.callRemote("main_resource_get", contact_jid, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
499 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
500 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
501 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
502 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
503 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
504 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
505 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
506 def menu_help_get(self, menu_id, language, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
507 d = self.root.callRemote("menu_help_get", menu_id, language) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
508 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
509 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
510 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
511 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
512 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
513 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
514 |
4284 | 515 def menu_launch( |
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 ) | |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
528 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
529 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
530 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
531 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
532 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
533 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
534 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
535 def menus_get(self, language, security_limit, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
536 d = self.root.callRemote("menus_get", language, security_limit) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
537 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
538 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
539 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
540 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
541 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
542 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
543 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
544 def message_encryption_get(self, to_jid, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
545 d = self.root.callRemote("message_encryption_get", to_jid, profile_key) |
3201
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
546 if callback is not None: |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
547 d.addCallback(callback) |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
548 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
549 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
550 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
551 d.addErrback(self._errback, ori_errback=errback) |
3201
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
552 |
4284 | 553 def message_encryption_start( |
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 ) | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
565 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
566 d.addCallback(lambda __: callback()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
567 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
568 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
569 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
570 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
571 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
572 def message_encryption_stop(self, to_jid, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
573 d = self.root.callRemote("message_encryption_stop", to_jid, profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
574 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
575 d.addCallback(lambda __: callback()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
576 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
577 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
578 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
579 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
580 |
4284 | 581 def message_send( |
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 ) | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
595 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
596 d.addCallback(lambda __: callback()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
597 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
598 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
599 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
600 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
601 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
602 def namespaces_get(self, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
603 d = self.root.callRemote("namespaces_get") |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
604 if callback is not None: |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
605 d.addCallback(callback) |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
606 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
607 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
608 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
609 d.addErrback(self._errback, ori_errback=errback) |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
610 |
4284 | 611 def notification_add( |
612 self, | |
613 type_, | |
614 body_plain, | |
615 body_rich, | |
616 title, | |
617 is_global, | |
618 requires_action, | |
619 arg_6, | |
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 ) | |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
639 if callback is not None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
640 d.addCallback(lambda __: callback()) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
641 if errback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
642 d.addErrback(self._generic_errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
643 else: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
644 d.addErrback(self._errback, ori_errback=errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
645 |
4284 | 646 def notification_delete( |
647 self, id_, is_global, profile_key, callback=None, errback=None | |
648 ): | |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
649 d = self.root.callRemote("notification_delete", id_, is_global, profile_key) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
650 if callback is not None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
651 d.addCallback(lambda __: callback()) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
652 if errback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
653 d.addErrback(self._generic_errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
654 else: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
655 d.addErrback(self._errback, ori_errback=errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
656 |
4284 | 657 def notifications_expired_clean( |
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 ) | |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
663 if callback is not None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
664 d.addCallback(lambda __: callback()) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
665 if errback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
666 d.addErrback(self._generic_errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
667 else: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
668 d.addErrback(self._errback, ori_errback=errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
669 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
670 def notifications_get(self, filters, profile_key, callback=None, errback=None): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
671 d = self.root.callRemote("notifications_get", filters, profile_key) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
672 if callback is not None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
673 d.addCallback(callback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
674 if errback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
675 d.addErrback(self._generic_errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
676 else: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
677 d.addErrback(self._errback, ori_errback=errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
678 |
4284 | 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 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
688 d = self.root.callRemote("param_get_a", name, category, attribute, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
689 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
690 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
691 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
692 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
693 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
694 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
695 |
4284 | 696 def param_get_a_async( |
697 self, | |
698 name, | |
699 category, | |
700 attribute="value", | |
701 security_limit=-1, | |
702 profile_key="@DEFAULT@", | |
703 callback=None, | |
704 errback=None, | |
705 ): | |
706 d = self.root.callRemote( | |
707 "param_get_a_async", name, category, attribute, security_limit, profile_key | |
708 ) | |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
709 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
710 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
711 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
712 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
713 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
714 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
715 |
4284 | 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 ) | |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
729 if callback is not None: |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
730 d.addCallback(lambda __: callback()) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
731 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
732 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
733 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
734 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
735 |
4284 | 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 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
745 d = self.root.callRemote("param_ui_get", security_limit, app, extra, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
746 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
747 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
748 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
749 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
750 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
751 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
752 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
753 def params_categories_get(self, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
754 d = self.root.callRemote("params_categories_get") |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
755 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
756 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
757 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
758 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
759 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
760 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
761 |
4284 | 762 def params_register_app( |
763 self, xml, security_limit=-1, app="", callback=None, errback=None | |
764 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
765 d = self.root.callRemote("params_register_app", xml, security_limit, app) |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
766 if callback is not None: |
2765
378188abe941
misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
Goffi <goffi@goffi.org>
parents:
2733
diff
changeset
|
767 d.addCallback(lambda __: callback()) |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
768 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
769 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
770 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
771 d.addErrback(self._errback, ori_errback=errback) |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
772 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
773 def params_template_load(self, filename, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
774 d = self.root.callRemote("params_template_load", filename) |
2646
712cb4ff3e13
core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents:
2628
diff
changeset
|
775 if callback is not None: |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
776 d.addCallback(callback) |
2646
712cb4ff3e13
core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents:
2628
diff
changeset
|
777 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
778 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
779 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
780 d.addErrback(self._errback, ori_errback=errback) |
2646
712cb4ff3e13
core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents:
2628
diff
changeset
|
781 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
782 def params_template_save(self, filename, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
783 d = self.root.callRemote("params_template_save", filename) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
784 if callback is not None: |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
785 d.addCallback(callback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
786 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
787 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
788 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
789 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
790 |
4284 | 791 def params_values_from_category_get_async( |
792 self, | |
793 category, | |
794 security_limit=-1, | |
795 app="", | |
796 extra="", | |
797 profile_key="@DEFAULT@", | |
798 callback=None, | |
799 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 ) | |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
809 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
810 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
811 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
812 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
813 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
814 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
815 |
4284 | 816 def presence_set( |
817 self, | |
818 to_jid="", | |
819 show="", | |
820 statuses={}, | |
821 profile_key="@DEFAULT@", | |
822 callback=None, | |
823 errback=None, | |
824 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
825 d = self.root.callRemote("presence_set", to_jid, show, statuses, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
826 if callback is not None: |
2765
378188abe941
misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
Goffi <goffi@goffi.org>
parents:
2733
diff
changeset
|
827 d.addCallback(lambda __: callback()) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
828 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
829 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
830 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
831 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
832 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
833 def presence_statuses_get(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
834 d = self.root.callRemote("presence_statuses_get", profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
835 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
836 d.addCallback(callback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
837 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
838 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
839 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
840 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
841 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
842 def private_data_delete(self, namespace, key, arg_2, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
843 d = self.root.callRemote("private_data_delete", namespace, key, arg_2) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
844 if callback is not None: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
845 d.addCallback(lambda __: callback()) |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
846 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
847 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
848 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
849 d.addErrback(self._errback, ori_errback=errback) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
850 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
851 def private_data_get(self, namespace, key, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
852 d = self.root.callRemote("private_data_get", namespace, key, profile_key) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
853 if callback is not None: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
854 d.addCallback(callback) |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
855 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
856 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
857 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
858 d.addErrback(self._errback, ori_errback=errback) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
859 |
4284 | 860 def private_data_set( |
861 self, namespace, key, data, profile_key, callback=None, errback=None | |
862 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
863 d = self.root.callRemote("private_data_set", namespace, key, data, profile_key) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
864 if callback is not None: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
865 d.addCallback(lambda __: callback()) |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
866 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
867 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
868 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
869 d.addErrback(self._errback, ori_errback=errback) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
870 |
4284 | 871 def profile_create( |
872 self, profile, password="", component="", callback=None, errback=None | |
873 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
874 d = self.root.callRemote("profile_create", profile, password, component) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
875 if callback is not None: |
2765
378188abe941
misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
Goffi <goffi@goffi.org>
parents:
2733
diff
changeset
|
876 d.addCallback(lambda __: callback()) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
877 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
878 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
879 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
880 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
881 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
882 def profile_delete_async(self, profile, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
883 d = self.root.callRemote("profile_delete_async", profile) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
884 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
885 d.addCallback(lambda __: callback()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
886 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
887 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
888 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
889 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
890 |
4284 | 891 def profile_is_session_started( |
892 self, profile_key="@DEFAULT@", callback=None, errback=None | |
893 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
894 d = self.root.callRemote("profile_is_session_started", profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
895 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
896 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
897 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
898 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
899 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
900 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
901 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
902 def profile_name_get(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
903 d = self.root.callRemote("profile_name_get", profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
904 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
905 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
906 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
907 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
908 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
909 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
910 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
911 def profile_set_default(self, profile, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
912 d = self.root.callRemote("profile_set_default", profile) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
913 if callback is not None: |
2765
378188abe941
misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
Goffi <goffi@goffi.org>
parents:
2733
diff
changeset
|
914 d.addCallback(lambda __: callback()) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
915 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
916 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
917 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
918 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
919 |
4284 | 920 def profile_start_session( |
921 self, password="", profile_key="@DEFAULT@", callback=None, errback=None | |
922 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
923 d = self.root.callRemote("profile_start_session", password, profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
924 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
925 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
926 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
927 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
928 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
929 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
930 |
4284 | 931 def profiles_list_get( |
932 self, clients=True, components=False, callback=None, errback=None | |
933 ): | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
934 d = self.root.callRemote("profiles_list_get", clients, components) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
935 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
936 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
937 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
938 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
939 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
940 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
941 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
942 def progress_get(self, id, profile, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
943 d = self.root.callRemote("progress_get", id, profile) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
944 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
945 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
946 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
947 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
948 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
949 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
950 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
951 def progress_get_all(self, profile, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
952 d = self.root.callRemote("progress_get_all", profile) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
953 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
954 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
955 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
956 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
957 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
958 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
959 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
960 def progress_get_all_metadata(self, profile, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
961 d = self.root.callRemote("progress_get_all_metadata", profile) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
962 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
963 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
964 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
965 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
966 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
967 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
968 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
969 def ready_get(self, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
970 d = self.root.callRemote("ready_get") |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
971 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
972 d.addCallback(lambda __: callback()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
973 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
974 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
975 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
976 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
977 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
978 def roster_resync(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
979 d = self.root.callRemote("roster_resync", profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
980 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
981 d.addCallback(lambda __: callback()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
982 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
983 d.addErrback(self._generic_errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
984 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
985 d.addErrback(self._errback, ori_errback=errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
986 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
987 def session_infos_get(self, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
988 d = self.root.callRemote("session_infos_get", profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
989 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
990 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
991 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
992 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
993 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
994 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
995 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
996 def sub_waiting_get(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
997 d = self.root.callRemote("sub_waiting_get", profile_key) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
998 if callback is not None: |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
999 d.addCallback(callback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1000 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1001 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1002 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1003 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1004 |
4284 | 1005 def subscription( |
1006 self, sub_type, entity, profile_key="@DEFAULT@", callback=None, errback=None | |
1007 ): | |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1008 d = self.root.callRemote("subscription", sub_type, entity, profile_key) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1009 if callback is not None: |
2765
378188abe941
misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
Goffi <goffi@goffi.org>
parents:
2733
diff
changeset
|
1010 d.addCallback(lambda __: callback()) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1011 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1012 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1013 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1014 d.addErrback(self._errback, ori_errback=errback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1015 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1016 def version_get(self, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1017 d = self.root.callRemote("version_get") |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1018 if callback is not None: |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1019 d.addCallback(callback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1020 if errback is None: |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1021 d.addErrback(self._generic_errback) |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1022 else: |
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1023 d.addErrback(self._errback, ori_errback=errback) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1024 |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1025 |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1026 class AIOSignalsHandler(SignalsHandler): |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1027 |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1028 def register_signal(self, name, handler, iface="core"): |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1029 async_handler = lambda *args, **kwargs: defer.Deferred.fromFuture( |
4270
0d7bb4df2343
Reformatted code base using black.
Goffi <goffi@goffi.org>
parents:
4193
diff
changeset
|
1030 asyncio.ensure_future(handler(*args, **kwargs)) |
0d7bb4df2343
Reformatted code base using black.
Goffi <goffi@goffi.org>
parents:
4193
diff
changeset
|
1031 ) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1032 return super().register_signal(name, async_handler, iface) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1033 |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1034 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1035 class AIOBridge(bridge): |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1036 |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1037 def __init__(self): |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1038 self.signals_handler = AIOSignalsHandler() |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1039 |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1040 def _errback(self, failure_): |
3243
f2e30aa031e9
bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents:
3206
diff
changeset
|
1041 """Convert Failure to BridgeException""" |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1042 raise BridgeException( |
4270
0d7bb4df2343
Reformatted code base using black.
Goffi <goffi@goffi.org>
parents:
4193
diff
changeset
|
1043 name=failure_.type.decode("utf-8"), message=str(failure_.value) |
0d7bb4df2343
Reformatted code base using black.
Goffi <goffi@goffi.org>
parents:
4193
diff
changeset
|
1044 ) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1045 |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1046 def call(self, name, *args, **kwargs): |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1047 d = self.root.callRemote(name, *args, *kwargs) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1048 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1049 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1050 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1051 async def bridge_connect(self): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1052 d = super().bridge_connect(callback=None, errback=None) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1053 return await d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1054 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1055 def action_launch(self, callback_id, data, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1056 d = self.root.callRemote("action_launch", callback_id, data, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1057 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1058 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1059 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1060 def actions_get(self, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1061 d = self.root.callRemote("actions_get", profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1062 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1063 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1064 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1065 def config_get(self, section, name): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1066 d = self.root.callRemote("config_get", section, name) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1067 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1068 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1069 |
4284 | 1070 def connect(self, profile_key="@DEFAULT@", password="", options={}): |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1071 d = self.root.callRemote("connect", profile_key, password, options) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1072 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1073 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1074 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1075 def contact_add(self, entity_jid, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1076 d = self.root.callRemote("contact_add", entity_jid, profile_key) |
3254
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
1077 d.addErrback(self._errback) |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
1078 return d.asFuture(asyncio.get_event_loop()) |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3243
diff
changeset
|
1079 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1080 def contact_del(self, entity_jid, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1081 d = self.root.callRemote("contact_del", entity_jid, profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1082 d.addErrback(self._errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1083 return d.asFuture(asyncio.get_event_loop()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1084 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1085 def contact_get(self, arg_0, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1086 d = self.root.callRemote("contact_get", arg_0, profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1087 d.addErrback(self._errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1088 return d.asFuture(asyncio.get_event_loop()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1089 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1090 def contact_update(self, entity_jid, name, groups, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1091 d = self.root.callRemote("contact_update", entity_jid, name, groups, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1092 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1093 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1094 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1095 def contacts_get(self, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1096 d = self.root.callRemote("contacts_get", profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1097 d.addErrback(self._errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1098 return d.asFuture(asyncio.get_event_loop()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1099 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1100 def contacts_get_from_group(self, group, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1101 d = self.root.callRemote("contacts_get_from_group", group, profile_key) |
3206
ae09989e9feb
core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents:
3201
diff
changeset
|
1102 d.addErrback(self._errback) |
ae09989e9feb
core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents:
3201
diff
changeset
|
1103 return d.asFuture(asyncio.get_event_loop()) |
ae09989e9feb
core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents:
3201
diff
changeset
|
1104 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1105 def devices_infos_get(self, bare_jid, profile_key): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1106 d = self.root.callRemote("devices_infos_get", bare_jid, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1107 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1108 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1109 |
4284 | 1110 def disco_find_by_features( |
1111 self, | |
1112 namespaces, | |
1113 identities, | |
1114 bare_jid=False, | |
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 ) | |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1132 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1133 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1134 |
4284 | 1135 def disco_infos(self, entity_jid, node="", use_cache=True, profile_key="@DEFAULT@"): |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1136 d = self.root.callRemote("disco_infos", entity_jid, node, use_cache, profile_key) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1137 d.addErrback(self._errback) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1138 return d.asFuture(asyncio.get_event_loop()) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1139 |
4284 | 1140 def disco_items(self, entity_jid, node="", use_cache=True, profile_key="@DEFAULT@"): |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1141 d = self.root.callRemote("disco_items", entity_jid, node, use_cache, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1142 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1143 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1144 |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1145 def disconnect(self, profile_key="@DEFAULT@"): |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1146 d = self.root.callRemote("disconnect", profile_key) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1147 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1148 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1149 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1150 def encryption_namespace_get(self, arg_0): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1151 d = self.root.callRemote("encryption_namespace_get", arg_0) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1152 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1153 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1154 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1155 def encryption_plugins_get(self): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1156 d = self.root.callRemote("encryption_plugins_get") |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1157 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1158 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1159 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1160 def encryption_trust_ui_get(self, to_jid, namespace, profile_key): |
4284 | 1161 d = self.root.callRemote( |
1162 "encryption_trust_ui_get", to_jid, namespace, profile_key | |
1163 ) | |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1164 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1165 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1166 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1167 def entities_data_get(self, jids, keys, profile): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1168 d = self.root.callRemote("entities_data_get", jids, keys, profile) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1169 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1170 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1171 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1172 def entity_data_get(self, jid, keys, profile): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1173 d = self.root.callRemote("entity_data_get", jid, keys, profile) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1174 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1175 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1176 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1177 def features_get(self, profile_key): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1178 d = self.root.callRemote("features_get", profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1179 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1180 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1181 |
4284 | 1182 def history_get( |
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 ) | |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1188 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1189 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1190 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1191 def image_check(self, arg_0): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1192 d = self.root.callRemote("image_check", arg_0) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1193 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1194 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1195 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1196 def image_convert(self, source, dest, arg_2, extra): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1197 d = self.root.callRemote("image_convert", source, dest, arg_2, extra) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1198 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1199 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1200 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1201 def image_generate_preview(self, image_path, profile_key): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1202 d = self.root.callRemote("image_generate_preview", image_path, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1203 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1204 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1205 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1206 def image_resize(self, image_path, width, height): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1207 d = self.root.callRemote("image_resize", image_path, width, height) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1208 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1209 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1210 |
4193
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
1211 def init_pre_script(self): |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
1212 d = self.root.callRemote("init_pre_script") |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
1213 d.addErrback(self._errback) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
1214 return d.asFuture(asyncio.get_event_loop()) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
1215 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1216 def is_connected(self, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1217 d = self.root.callRemote("is_connected", profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1218 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1219 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1220 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1221 def main_resource_get(self, contact_jid, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1222 d = self.root.callRemote("main_resource_get", contact_jid, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1223 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1224 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1225 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1226 def menu_help_get(self, menu_id, language): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1227 d = self.root.callRemote("menu_help_get", menu_id, language) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1228 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1229 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1230 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1231 def menu_launch(self, menu_type, path, data, security_limit, profile_key): |
4284 | 1232 d = self.root.callRemote( |
1233 "menu_launch", menu_type, path, data, security_limit, profile_key | |
1234 ) | |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1235 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1236 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1237 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1238 def menus_get(self, language, security_limit): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1239 d = self.root.callRemote("menus_get", language, security_limit) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1240 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1241 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1242 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1243 def message_encryption_get(self, to_jid, profile_key): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1244 d = self.root.callRemote("message_encryption_get", to_jid, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1245 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1246 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1247 |
4284 | 1248 def message_encryption_start( |
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 ) | |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
1254 d.addErrback(self._errback) |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
1255 return d.asFuture(asyncio.get_event_loop()) |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
1256 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1257 def message_encryption_stop(self, to_jid, profile_key): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1258 d = self.root.callRemote("message_encryption_stop", to_jid, profile_key) |
3259
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
1259 d.addErrback(self._errback) |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
1260 return d.asFuture(asyncio.get_event_loop()) |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
1261 |
4284 | 1262 def message_send( |
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 ) | |
3201
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
1274 d.addErrback(self._errback) |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
1275 return d.asFuture(asyncio.get_event_loop()) |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
1276 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1277 def namespaces_get(self): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1278 d = self.root.callRemote("namespaces_get") |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
1279 d.addErrback(self._errback) |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
1280 return d.asFuture(asyncio.get_event_loop()) |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3063
diff
changeset
|
1281 |
4284 | 1282 def notification_add( |
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 ) | |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1308 d.addErrback(self._errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1309 return d.asFuture(asyncio.get_event_loop()) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1310 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1311 def notification_delete(self, id_, is_global, profile_key): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1312 d = self.root.callRemote("notification_delete", id_, is_global, profile_key) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1313 d.addErrback(self._errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1314 return d.asFuture(asyncio.get_event_loop()) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1315 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1316 def notifications_expired_clean(self, limit_timestamp, profile_key): |
4284 | 1317 d = self.root.callRemote( |
1318 "notifications_expired_clean", limit_timestamp, profile_key | |
1319 ) | |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1320 d.addErrback(self._errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1321 return d.asFuture(asyncio.get_event_loop()) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1322 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1323 def notifications_get(self, filters, profile_key): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1324 d = self.root.callRemote("notifications_get", filters, profile_key) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1325 d.addErrback(self._errback) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1326 return d.asFuture(asyncio.get_event_loop()) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1327 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1328 def param_get_a(self, name, category, attribute="value", profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1329 d = self.root.callRemote("param_get_a", name, category, attribute, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1330 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1331 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1332 |
4284 | 1333 def param_get_a_async( |
1334 self, | |
1335 name, | |
1336 category, | |
1337 attribute="value", | |
1338 security_limit=-1, | |
1339 profile_key="@DEFAULT@", | |
1340 ): | |
1341 d = self.root.callRemote( | |
1342 "param_get_a_async", name, category, attribute, security_limit, profile_key | |
1343 ) | |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1344 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1345 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1346 |
4284 | 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 ) | |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1353 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1354 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1355 |
4284 | 1356 def param_ui_get(self, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"): |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1357 d = self.root.callRemote("param_ui_get", security_limit, app, extra, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1358 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1359 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1360 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1361 def params_categories_get(self): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1362 d = self.root.callRemote("params_categories_get") |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1363 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1364 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1365 |
4284 | 1366 def params_register_app(self, xml, security_limit=-1, app=""): |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1367 d = self.root.callRemote("params_register_app", xml, security_limit, app) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1368 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1369 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1370 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1371 def params_template_load(self, filename): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1372 d = self.root.callRemote("params_template_load", filename) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1373 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1374 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1375 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1376 def params_template_save(self, filename): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1377 d = self.root.callRemote("params_template_save", filename) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1378 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1379 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1380 |
4284 | 1381 def params_values_from_category_get_async( |
1382 self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@" | |
1383 ): | |
1384 d = self.root.callRemote( | |
1385 "params_values_from_category_get_async", | |
1386 category, | |
1387 security_limit, | |
1388 app, | |
1389 extra, | |
1390 profile_key, | |
1391 ) | |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1392 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1393 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1394 |
4284 | 1395 def presence_set(self, to_jid="", show="", statuses={}, profile_key="@DEFAULT@"): |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1396 d = self.root.callRemote("presence_set", to_jid, show, statuses, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1397 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1398 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1399 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1400 def presence_statuses_get(self, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1401 d = self.root.callRemote("presence_statuses_get", profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1402 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1403 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1404 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1405 def private_data_delete(self, namespace, key, arg_2): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1406 d = self.root.callRemote("private_data_delete", namespace, key, arg_2) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1407 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1408 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1409 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1410 def private_data_get(self, namespace, key, profile_key): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1411 d = self.root.callRemote("private_data_get", namespace, key, profile_key) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
1412 d.addErrback(self._errback) |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
1413 return d.asFuture(asyncio.get_event_loop()) |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
1414 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1415 def private_data_set(self, namespace, key, data, profile_key): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1416 d = self.root.callRemote("private_data_set", namespace, key, data, profile_key) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
1417 d.addErrback(self._errback) |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
1418 return d.asFuture(asyncio.get_event_loop()) |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
1419 |
4284 | 1420 def profile_create(self, profile, password="", component=""): |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1421 d = self.root.callRemote("profile_create", profile, password, component) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
1422 d.addErrback(self._errback) |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
1423 return d.asFuture(asyncio.get_event_loop()) |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3137
diff
changeset
|
1424 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1425 def profile_delete_async(self, profile): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1426 d = self.root.callRemote("profile_delete_async", profile) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1427 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1428 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1429 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1430 def profile_is_session_started(self, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1431 d = self.root.callRemote("profile_is_session_started", profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1432 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1433 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1434 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1435 def profile_name_get(self, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1436 d = self.root.callRemote("profile_name_get", profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1437 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1438 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1439 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1440 def profile_set_default(self, profile): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1441 d = self.root.callRemote("profile_set_default", profile) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1442 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1443 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1444 |
4284 | 1445 def profile_start_session(self, password="", profile_key="@DEFAULT@"): |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1446 d = self.root.callRemote("profile_start_session", password, profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1447 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1448 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1449 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1450 def profiles_list_get(self, clients=True, components=False): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1451 d = self.root.callRemote("profiles_list_get", clients, components) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1452 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1453 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1454 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1455 def progress_get(self, id, profile): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1456 d = self.root.callRemote("progress_get", id, profile) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1457 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1458 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1459 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1460 def progress_get_all(self, profile): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1461 d = self.root.callRemote("progress_get_all", profile) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1462 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1463 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1464 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1465 def progress_get_all_metadata(self, profile): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1466 d = self.root.callRemote("progress_get_all_metadata", profile) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1467 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1468 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1469 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1470 def ready_get(self): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1471 d = self.root.callRemote("ready_get") |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1472 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1473 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1474 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1475 def roster_resync(self, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1476 d = self.root.callRemote("roster_resync", profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1477 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1478 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1479 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1480 def session_infos_get(self, profile_key): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1481 d = self.root.callRemote("session_infos_get", profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1482 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1483 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1484 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1485 def sub_waiting_get(self, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1486 d = self.root.callRemote("sub_waiting_get", profile_key) |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1487 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1488 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1489 |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1490 def subscription(self, sub_type, entity, profile_key="@DEFAULT@"): |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1491 d = self.root.callRemote("subscription", sub_type, entity, profile_key) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1492 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1493 return d.asFuture(asyncio.get_event_loop()) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1494 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1495 def version_get(self): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3634
diff
changeset
|
1496 d = self.root.callRemote("version_get") |
3039
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1497 d.addErrback(self._errback) |
a1bc34f90fa5
bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents:
3028
diff
changeset
|
1498 return d.asFuture(asyncio.get_event_loop()) |