annotate libervia/frontends/bridge/pb.py @ 4280:4cf98f506269

bridge(constructor): fix template parsing, which was broken following `black` reformating.
author Goffi <goffi@goffi.org>
date Fri, 12 Jul 2024 17:58:06 +0200
parents 0d7bb4df2343
children 3a550e9a2b55
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
1 #!/usr/bin/env python3
3137
559a625a236b fixed shebangs
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
2
3254
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
3 # SàT communication bridge
3479
be6d91572633 date update
Goffi <goffi@goffi.org>
parents: 3259
diff changeset
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
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
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
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
164
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
165 def action_launch(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
166 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
167 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
168 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
169 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
170 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
171 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
172 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
173
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
174 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
175 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
176 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
177 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
178 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
179 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
180 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
181 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
182
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
183 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
184 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
185 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
186 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
187 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
188 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
189 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
190 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
191
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
192 def connect(self, profile_key="@DEFAULT@", password='', options={}, callback=None, errback=None):
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
193 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
194 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
195 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
196 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
197 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
198 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
199 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
200
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
201 def contact_add(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
202 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
203 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
204 d.addCallback(lambda __: callback())
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
205 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
206 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
207 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
208 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
209
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
210 def contact_del(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
211 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
212 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
213 d.addCallback(lambda __: callback())
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
214 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
215 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
216 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
217 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
218
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
219 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
220 d = self.root.callRemote("contact_get", arg_0, profile_key)
3254
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
221 if callback is not None:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
222 d.addCallback(callback)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
223 if errback is None:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
224 d.addErrback(self._generic_errback)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
225 else:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
226 d.addErrback(self._errback, ori_errback=errback)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
227
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
228 def contact_update(self, entity_jid, name, groups, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
229 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
230 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
231 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
232 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
233 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
234 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
235 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
236
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
237 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
238 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
239 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
240 d.addCallback(callback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
241 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
242 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
243 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
244 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
245
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
246 def contacts_get_from_group(self, group, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
247 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
248 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
249 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
250 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
251 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
252 else:
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._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
254
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
255 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
256 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
257 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
258 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
259 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
260 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
261 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
262 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
263
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
264 def disco_find_by_features(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@", callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
265 d = self.root.callRemote("disco_find_by_features", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
266 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
267 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
268 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
269 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
270 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
271 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
272
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
273 def disco_infos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
274 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
275 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
276 d.addCallback(callback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
277 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
278 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
279 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
280 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
281
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
282 def disco_items(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
283 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
284 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
285 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
286 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
287 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
288 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
289 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
290
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
291 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
292 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
293 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
294 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
295 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
296 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
297 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
298 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
299
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
300 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
301 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
302 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
303 d.addCallback(callback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
304 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
305 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
306 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
307 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
308
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
309 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
310 d = self.root.callRemote("encryption_plugins_get")
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
311 if callback is not None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
312 d.addCallback(callback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
313 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
314 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
315 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
316 d.addErrback(self._errback, ori_errback=errback)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
317
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
318 def encryption_trust_ui_get(self, to_jid, namespace, profile_key, callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
319 d = self.root.callRemote("encryption_trust_ui_get", to_jid, namespace, profile_key)
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
320 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
321 d.addCallback(callback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
322 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
323 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
324 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
325 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
326
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
327 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
328 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
329 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
330 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
331 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
332 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
333 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
334 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
335
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
336 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
337 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
338 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
339 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
340 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
341 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
342 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
343 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
344
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
345 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
346 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
347 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
348 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
349 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
350 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
351 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
352 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
353
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
354 def history_get(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@", callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
355 d = self.root.callRemote("history_get", from_jid, to_jid, limit, between, filters, profile)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
356 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
357 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
358 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
359 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
360 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
361 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
362
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
363 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
364 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
365 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
366 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
367 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
368 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
369 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
370 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
371
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
372 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
373 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
374 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
375 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
376 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
377 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
378 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
379 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
380
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
381 def image_generate_preview(self, image_path, profile_key, callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
382 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
383 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
384 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
385 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
386 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
387 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
388 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
389
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
390 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
391 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
392 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
393 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
394 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
395 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
396 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
397 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
398
4193
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
399 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
400 d = self.root.callRemote("init_pre_script")
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
401 if callback is not None:
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
402 d.addCallback(lambda __: callback())
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
403 if errback is None:
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
404 d.addErrback(self._generic_errback)
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
405 else:
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
406 d.addErrback(self._errback, ori_errback=errback)
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
407
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
408 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
409 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
410 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
411 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
412 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
413 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
414 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
415 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
416
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
417 def main_resource_get(self, contact_jid, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
418 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
419 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
420 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
421 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
422 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
423 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
424 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
425
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
426 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
427 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
428 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
429 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
430 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
431 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
432 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
433 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
434
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
435 def menu_launch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
436 d = self.root.callRemote("menu_launch", menu_type, path, data, security_limit, profile_key)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
437 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
438 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
439 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
440 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
441 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
442 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
443
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
444 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
445 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
446 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
447 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
448 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
449 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
450 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
451 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
452
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
453 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
454 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
455 if callback is not None:
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
456 d.addCallback(callback)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
457 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
458 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
459 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
460 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
461
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
462 def message_encryption_start(self, to_jid, namespace='', replace=False, profile_key="@NONE@", callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
463 d = self.root.callRemote("message_encryption_start", to_jid, namespace, replace, profile_key)
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
464 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
465 d.addCallback(lambda __: callback())
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
466 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
467 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
468 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
469 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
470
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
471 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
472 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
473 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
474 d.addCallback(lambda __: callback())
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
475 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
476 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
477 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
478 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
479
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
480 def message_send(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
481 d = self.root.callRemote("message_send", to_jid, message, subject, mess_type, extra, profile_key)
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
482 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
483 d.addCallback(lambda __: callback())
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
484 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
485 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
486 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
487 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
488
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
489 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
490 d = self.root.callRemote("namespaces_get")
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
491 if callback is not None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
492 d.addCallback(callback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
493 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
494 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
495 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
496 d.addErrback(self._errback, ori_errback=errback)
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
497
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
498 def notification_add(self, type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra, callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
499 d = self.root.callRemote("notification_add", type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra)
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
500 if callback is not None:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
501 d.addCallback(lambda __: callback())
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
502 if errback is None:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
503 d.addErrback(self._generic_errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
504 else:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
505 d.addErrback(self._errback, ori_errback=errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
506
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
507 def notification_delete(self, id_, is_global, profile_key, callback=None, errback=None):
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
508 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
509 if callback is not None:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
510 d.addCallback(lambda __: callback())
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
511 if errback is None:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
512 d.addErrback(self._generic_errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
513 else:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
514 d.addErrback(self._errback, ori_errback=errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
515
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
516 def notifications_expired_clean(self, limit_timestamp, profile_key, callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
517 d = self.root.callRemote("notifications_expired_clean", limit_timestamp, profile_key)
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
518 if callback is not None:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
519 d.addCallback(lambda __: callback())
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
520 if errback is None:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
521 d.addErrback(self._generic_errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
522 else:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
523 d.addErrback(self._errback, ori_errback=errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
524
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
525 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
526 d = self.root.callRemote("notifications_get", filters, profile_key)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
527 if callback is not None:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
528 d.addCallback(callback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
529 if errback is None:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
530 d.addErrback(self._generic_errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
531 else:
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
532 d.addErrback(self._errback, ori_errback=errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
533
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
534 def param_get_a(self, name, category, attribute="value", profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
535 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
536 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
537 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
538 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
539 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
540 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
541 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
542
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
543 def param_get_a_async(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
544 d = self.root.callRemote("param_get_a_async", name, category, attribute, security_limit, profile_key)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
545 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
546 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
547 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
548 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
549 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
550 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
551
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
552 def param_set(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
553 d = self.root.callRemote("param_set", name, value, category, security_limit, profile_key)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
554 if callback is not None:
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
555 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
556 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
557 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
558 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
559 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
560
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
561 def param_ui_get(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
562 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
563 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
564 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
565 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
566 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
567 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
568 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
569
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
570 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
571 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
572 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
573 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
574 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
575 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
576 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
577 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
578
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
579 def params_register_app(self, xml, security_limit=-1, app='', callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
580 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
581 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
582 d.addCallback(lambda __: callback())
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
583 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
584 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
585 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
586 d.addErrback(self._errback, ori_errback=errback)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
587
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
588 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
589 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
590 if callback is not None:
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
591 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
592 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
593 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
594 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
595 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
596
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
597 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
598 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
599 if callback is not None:
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
600 d.addCallback(callback)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
601 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
602 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
603 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
604 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
605
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
606 def params_values_from_category_get_async(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@", callback=None, errback=None):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
607 d = self.root.callRemote("params_values_from_category_get_async", category, 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
608 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
609 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
610 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
611 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
612 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
613 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
614
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
615 def presence_set(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
616 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
617 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
618 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
619 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
620 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
621 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
622 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
623
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
624 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
625 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
626 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
627 d.addCallback(callback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
628 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
629 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
630 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
631 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
632
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
633 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
634 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
635 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
636 d.addCallback(lambda __: callback())
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
637 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
638 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
639 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
640 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
641
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
642 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
643 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
644 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
645 d.addCallback(callback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
646 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
647 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
648 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
649 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
650
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
651 def private_data_set(self, namespace, key, data, profile_key, callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
652 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
653 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
654 d.addCallback(lambda __: callback())
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
655 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
656 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
657 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
658 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
659
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
660 def profile_create(self, profile, password='', component='', callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
661 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
662 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
663 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
664 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
665 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
666 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
667 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
668
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
669 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
670 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
671 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
672 d.addCallback(lambda __: callback())
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
673 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
674 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
675 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
676 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
677
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
678 def profile_is_session_started(self, profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
679 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
680 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
681 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
682 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
683 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
684 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
685 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
686
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
687 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
688 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
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
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
696 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
697 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
698 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
699 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
700 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
701 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
702 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
703 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
704
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
705 def profile_start_session(self, password='', profile_key="@DEFAULT@", callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
706 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
707 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
708 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
709 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
710 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
711 else:
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._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
713
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
714 def profiles_list_get(self, clients=True, components=False, callback=None, errback=None):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
715 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
716 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
717 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
718 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
719 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
720 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
721 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
722
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
723 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
724 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
725 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
726 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
727 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
728 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
729 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
730 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
731
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
732 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
733 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
734 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
735 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
736 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
737 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
738 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
739 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
740
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
741 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
742 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
743 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
744 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
745 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
746 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
747 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
748 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
749
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
750 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
751 d = self.root.callRemote("ready_get")
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
752 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
753 d.addCallback(lambda __: callback())
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
754 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
755 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
756 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
757 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
758
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
759 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
760 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
761 if callback is not None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
762 d.addCallback(lambda __: callback())
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
763 if errback is None:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
764 d.addErrback(self._generic_errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
765 else:
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
766 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
767
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
768 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
769 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
770 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
771 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
772 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
773 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
774 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
775 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
776
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
777 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
778 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
779 if callback is not None:
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
780 d.addCallback(callback)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
781 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
782 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
783 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
784 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
785
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
786 def subscription(self, sub_type, entity, profile_key="@DEFAULT@", callback=None, errback=None):
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
787 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
788 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
789 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
790 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
791 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
792 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
793 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
794
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
795 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
796 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
797 if callback is not None:
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
798 d.addCallback(callback)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
799 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
800 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
801 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
802 d.addErrback(self._errback, ori_errback=errback)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
803
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
804
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
805
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
806 class AIOSignalsHandler(SignalsHandler):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
807
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
808 def register_signal(self, name, handler, iface="core"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
809 async_handler = lambda *args, **kwargs: defer.Deferred.fromFuture(
4270
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
810 asyncio.ensure_future(handler(*args, **kwargs))
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
811 )
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
812 return super().register_signal(name, async_handler, iface)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
813
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
814
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
815 class AIOBridge(bridge):
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
816
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
817 def __init__(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
818 self.signals_handler = AIOSignalsHandler()
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
819
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
820 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
821 """Convert Failure to BridgeException"""
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
822 raise BridgeException(
4270
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
823 name=failure_.type.decode("utf-8"), message=str(failure_.value)
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
824 )
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
825
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
826 def call(self, name, *args, **kwargs):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
827 d = self.root.callRemote(name, *args, *kwargs)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
828 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
829 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
830
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
831 async def bridge_connect(self):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
832 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
833 return await d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
834
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
835
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
836 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
837 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
838 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
839 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
840
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
841 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
842 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
843 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
844 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
845
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
846 def config_get(self, section, name):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
847 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
848 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
849 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
850
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
851 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
852 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
853 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
854 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
855
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
856 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
857 d = self.root.callRemote("contact_add", entity_jid, profile_key)
3254
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
858 d.addErrback(self._errback)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
859 return d.asFuture(asyncio.get_event_loop())
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
860
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
861 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
862 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
863 d.addErrback(self._errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
864 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
865
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
866 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
867 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
868 d.addErrback(self._errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
869 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
870
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
871 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
872 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
873 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
874 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
875
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
876 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
877 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
878 d.addErrback(self._errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
879 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
880
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
881 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
882 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
883 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
884 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
885
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
886 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
887 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
888 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
889 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
890
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
891 def disco_find_by_features(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@"):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
892 d = self.root.callRemote("disco_find_by_features", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
893 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
894 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
895
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
896 def disco_infos(self, entity_jid, node=u'', 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
897 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
898 d.addErrback(self._errback)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
899 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
900
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
901 def disco_items(self, entity_jid, node=u'', 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
902 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
903 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
904 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
905
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
906 def disconnect(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
907 d = self.root.callRemote("disconnect", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
908 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
909 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
910
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
911 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
912 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
913 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
914 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
915
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
916 def encryption_plugins_get(self):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
917 d = self.root.callRemote("encryption_plugins_get")
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
918 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
919 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
920
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
921 def encryption_trust_ui_get(self, to_jid, namespace, profile_key):
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
922 d = self.root.callRemote("encryption_trust_ui_get", to_jid, namespace, profile_key)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
923 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
924 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
925
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
926 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
927 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
928 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
929 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
930
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
931 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
932 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
933 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
934 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
935
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
936 def features_get(self, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
937 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
938 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
939 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
940
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
941 def history_get(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@"):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
942 d = self.root.callRemote("history_get", from_jid, to_jid, limit, between, filters, profile)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
943 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
944 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
945
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
946 def image_check(self, arg_0):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
947 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
948 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
949 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
950
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
951 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
952 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
953 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
954 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
955
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
956 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
957 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
958 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
959 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
960
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
961 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
962 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
963 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
964 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
965
4193
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
966 def init_pre_script(self):
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
967 d = self.root.callRemote("init_pre_script")
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
968 d.addErrback(self._errback)
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
969 return d.asFuture(asyncio.get_event_loop())
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
970
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
971 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
972 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
973 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
974 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
975
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
976 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
977 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
978 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
979 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
980
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
981 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
982 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
983 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
984 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
985
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
986 def menu_launch(self, menu_type, path, data, security_limit, profile_key):
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
987 d = self.root.callRemote("menu_launch", menu_type, path, data, security_limit, profile_key)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
988 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
989 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
990
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
991 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
992 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
993 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
994 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
995
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
996 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
997 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
998 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
999 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1000
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1001 def message_encryption_start(self, to_jid, namespace='', replace=False, profile_key="@NONE@"):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1002 d = self.root.callRemote("message_encryption_start", to_jid, namespace, replace, profile_key)
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
1003 d.addErrback(self._errback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
1004 return d.asFuture(asyncio.get_event_loop())
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
1005
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1006 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
1007 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
1008 d.addErrback(self._errback)
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1009 return d.asFuture(asyncio.get_event_loop())
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1010
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1011 def message_send(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@"):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1012 d = self.root.callRemote("message_send", to_jid, message, subject, mess_type, extra, profile_key)
3201
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1013 d.addErrback(self._errback)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1014 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
1015
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1016 def namespaces_get(self):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1017 d = self.root.callRemote("namespaces_get")
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
1018 d.addErrback(self._errback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
1019 return d.asFuture(asyncio.get_event_loop())
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
1020
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1021 def notification_add(self, type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1022 d = self.root.callRemote("notification_add", type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra)
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1023 d.addErrback(self._errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1024 return d.asFuture(asyncio.get_event_loop())
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1025
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1026 def notification_delete(self, id_, is_global, profile_key):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1027 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
1028 d.addErrback(self._errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1029 return d.asFuture(asyncio.get_event_loop())
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1030
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1031 def notifications_expired_clean(self, limit_timestamp, profile_key):
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1032 d = self.root.callRemote("notifications_expired_clean", limit_timestamp, profile_key)
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1033 d.addErrback(self._errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1034 return d.asFuture(asyncio.get_event_loop())
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1035
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1036 def notifications_get(self, filters, profile_key):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1037 d = self.root.callRemote("notifications_get", filters, profile_key)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1038 d.addErrback(self._errback)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1039 return d.asFuture(asyncio.get_event_loop())
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4074
diff changeset
1040
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1041 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
1042 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
1043 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1044 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1045
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1046 def param_get_a_async(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@"):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1047 d = self.root.callRemote("param_get_a_async", name, category, attribute, security_limit, profile_key)
3039
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
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1051 def param_set(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1052 d = self.root.callRemote("param_set", name, value, category, security_limit, profile_key)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1053 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1054 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1055
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1056 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
1057 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
1058 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1059 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1060
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1061 def params_categories_get(self):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1062 d = self.root.callRemote("params_categories_get")
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1063 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1064 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1065
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1066 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
1067 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
1068 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1069 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1070
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1071 def params_template_load(self, filename):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1072 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
1073 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1074 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1075
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1076 def params_template_save(self, filename):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1077 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
1078 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1079 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1080
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1081 def params_values_from_category_get_async(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"):
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1082 d = self.root.callRemote("params_values_from_category_get_async", category, security_limit, app, extra, profile_key)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1083 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1084 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1085
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1086 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
1087 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
1088 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1089 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1090
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1091 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
1092 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
1093 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1094 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1095
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1096 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
1097 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
1098 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1099 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1100
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1101 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
1102 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
1103 d.addErrback(self._errback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
1104 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
1105
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1106 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
1107 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
1108 d.addErrback(self._errback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
1109 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
1110
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1111 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
1112 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
1113 d.addErrback(self._errback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
1114 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
1115
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1116 def profile_delete_async(self, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1117 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
1118 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1119 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1120
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1121 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
1122 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
1123 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1124 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1125
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1126 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
1127 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
1128 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1129 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1130
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1131 def profile_set_default(self, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1132 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
1133 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1134 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1135
4280
4cf98f506269 bridge(constructor): fix template parsing, which was broken following `black` reformating.
Goffi <goffi@goffi.org>
parents: 4270
diff changeset
1136 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
1137 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
1138 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1139 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1140
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1141 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
1142 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
1143 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1144 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1145
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1146 def progress_get(self, id, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1147 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
1148 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1149 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1150
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1151 def progress_get_all(self, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1152 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
1153 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1154 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1155
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1156 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
1157 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
1158 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1159 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1160
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1161 def ready_get(self):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1162 d = self.root.callRemote("ready_get")
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1163 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1164 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1165
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1166 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
1167 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
1168 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1169 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1170
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1171 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
1172 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
1173 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1174 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1175
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1176 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
1177 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
1178 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1179 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1180
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1181 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
1182 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
1183 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1184 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1185
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1186 def version_get(self):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3634
diff changeset
1187 d = self.root.callRemote("version_get")
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())