annotate sat_frontends/bridge/pb.py @ 3243:f2e30aa031e9

bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
author Goffi <goffi@goffi.org>
date Wed, 01 Apr 2020 15:40:29 +0200
parents ae09989e9feb
children 6cf4bd6972c2
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
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
3
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # SAT communication bridge
3136
9d0df638c8b4 dates update
Goffi <goffi@goffi.org>
parents: 3123
diff changeset
5 # Copyright (C) 2009-2020 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
6
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # 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
8 # 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
9 # 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
10 # (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
11
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # 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
13 # 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
14 # 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
15 # 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
16
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # 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
18 # 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
19
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
20 import asyncio
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
21 from functools import partial
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
22 from twisted.spread import pb
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
23 from twisted.internet import reactor, defer
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
24 from twisted.internet.error import ConnectionRefusedError
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
25 from logging import getLogger
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
26 from sat.core import exceptions
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
27 from sat_frontends.bridge.bridge_frontend import BridgeException
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
28
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
29 log = getLogger(__name__)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
30
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 class SignalsHandler(pb.Referenceable):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
33 def __getattr__(self, name):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
34 if name.startswith("remote_"):
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
35 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
36 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
37
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
38 else:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
39 raise AttributeError(name)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
40
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
41 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
42 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
43 method_name = "remote_" + name
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
44 try:
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
45 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
46 except AttributeError:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
47 pass
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
48 else:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
49 raise exceptions.InternalError(
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
50 "{name} signal handler has been registered twice".format(
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
51 name=method_name
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
52 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
53 )
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
54 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
55
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
56
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
57 class Bridge(object):
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
58
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
59 def __init__(self):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
60 self.signals_handler = SignalsHandler()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
61
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
62 def __getattr__(self, name):
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
63 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
64
3063
84bb63e1e4c4 bridge (pb): added missing _generic_errback
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
65 def _generic_errback(self, err):
84bb63e1e4c4 bridge (pb): added missing _generic_errback
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
66 log.error(f"bridge error: {err}")
84bb63e1e4c4 bridge (pb): added missing _generic_errback
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
67
3243
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
68 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
69 """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
70 ori_errback(
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
71 BridgeException(
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
72 name=failure_.type.decode('utf-8'),
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
73 message=str(failure_.value)
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
74 )
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
75 )
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
76
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
77 def remoteCallback(self, result, callback):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
78 """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
79
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
80 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
81 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
82 @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
83 @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
84 """
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
85 if result is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
86 callback()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
87 else:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
88 callback(result)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
89
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
90 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
91 """call a remote method
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
92
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
93 @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
94 @param args(list): 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 as last 2 items
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
96 @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
97 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
98 """
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
99 callback = errback = None
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
100 if kwargs:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
101 try:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
102 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
103 except KeyError:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
104 pass
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
105 try:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
106 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
107 except KeyError:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
108 pass
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
109 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
110 errback = args.pop()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
111 callback = args.pop()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
112 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
113 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
114 d.addCallback(self.remoteCallback, callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
115 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
116 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
117
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
118 def _initBridgeEb(self, failure_):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
119 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
120 return failure_
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
121
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
122 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
123 """set remote root object
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 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
126 """
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
127 self.root = root
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
128 d = root.callRemote("initBridge", self.signals_handler)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
129 d.addErrback(self._initBridgeEb)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
130 return d
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
131
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
132 def getRootObjectEb(self, failure_):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
133 """Call errback with appropriate bridge error"""
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
134 if failure_.check(ConnectionRefusedError):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
135 raise exceptions.BridgeExceptionNoService
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
136 else:
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
137 raise failure_
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
138
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
139 def bridgeConnect(self, callback, errback):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
140 factory = pb.PBClientFactory()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
141 reactor.connectTCP("localhost", 8789, factory)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
142 d = factory.getRootObject()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
143 d.addCallback(self._set_root)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
144 if callback is not None:
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
145 d.addCallback(lambda __: callback())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
146 d.addErrback(self.getRootObjectEb)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
147 if errback is not None:
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
148 d.addErrback(lambda failure_: errback(failure_.value))
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
149 return d
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
150
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
151 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
152 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
153
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
154
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
155 def actionsGet(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
156 d = self.root.callRemote("actionsGet", profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
157 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
158 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
159 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
160 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
161 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
162 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
163
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
164 def addContact(self, entity_jid, 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
165 d = self.root.callRemote("addContact", entity_jid, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
166 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
167 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
168 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
169 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
170 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
171 d.addErrback(self._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
172
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
173 def asyncDeleteProfile(self, profile, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
174 d = self.root.callRemote("asyncDeleteProfile", profile)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
175 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
176 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
177 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
178 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
179 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
180 d.addErrback(self._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
181
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
182 def asyncGetParamA(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
183 d = self.root.callRemote("asyncGetParamA", 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
184 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
185 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
186 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
187 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
188 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
189 d.addErrback(self._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
190
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
191 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@", callback=None, errback=None):
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
192 d = self.root.callRemote("asyncGetParamsValuesFromCategory", 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
193 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
194 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
195 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
196 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
197 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
198 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
199
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
200 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
201 d = self.root.callRemote("connect", profile_key, password, options)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
202 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
203 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
204 if errback is None:
3243
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
205 d.addErrback(self._generic_errback)
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
206 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
207 d.addErrback(self._errback, ori_errback=errback)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
208
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
209 def delContact(self, entity_jid, 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
210 d = self.root.callRemote("delContact", entity_jid, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
211 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
212 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
213 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
214 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
215 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
216 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
217
3206
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
218 def devicesInfosGet(self, bare_jid, profile_key, callback=None, errback=None):
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
219 d = self.root.callRemote("devicesInfosGet", bare_jid, profile_key)
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
220 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
221 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
222 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
223 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
224 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
225 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
226
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
227 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@", callback=None, errback=None):
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
228 d = self.root.callRemote("discoFindByFeatures", 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
229 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
230 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
231 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
232 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
233 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
234 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
235
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
236 def discoInfos(self, entity_jid, node=u'', use_cache=True, 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
237 d = self.root.callRemote("discoInfos", entity_jid, node, use_cache, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
238 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
239 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
240 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
241 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
242 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
243 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
244
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
245 def discoItems(self, entity_jid, node=u'', use_cache=True, 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
246 d = self.root.callRemote("discoItems", entity_jid, node, use_cache, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
247 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
248 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
249 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
250 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
251 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
252 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
253
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
254 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
255 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
256 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
257 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
258 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
259 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
260 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
261 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
262
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
263 def encryptionNamespaceGet(self, arg_0, callback=None, errback=None):
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
264 d = self.root.callRemote("encryptionNamespaceGet", arg_0)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
265 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
266 d.addCallback(callback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
267 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
268 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
269 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
270 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
271
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
272 def encryptionPluginsGet(self, callback=None, errback=None):
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
273 d = self.root.callRemote("encryptionPluginsGet")
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
274 if callback is not None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
275 d.addCallback(callback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
276 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
277 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
278 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
279 d.addErrback(self._errback, ori_errback=errback)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
280
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
281 def encryptionTrustUIGet(self, to_jid, namespace, profile_key, callback=None, errback=None):
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
282 d = self.root.callRemote("encryptionTrustUIGet", to_jid, namespace, profile_key)
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
283 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
284 d.addCallback(callback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
285 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
286 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
287 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
288 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
289
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
290 def getConfig(self, section, name, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
291 d = self.root.callRemote("getConfig", section, name)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
292 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
293 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
294 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
295 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
296 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
297 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
298
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
299 def getContacts(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
300 d = self.root.callRemote("getContacts", profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
301 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
302 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
303 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
304 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
305 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
306 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
307
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
308 def getContactsFromGroup(self, group, 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
309 d = self.root.callRemote("getContactsFromGroup", group, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
310 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
311 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
312 if errback is None:
3243
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
313 d.addErrback(self._generic_errback)
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
314 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
315 d.addErrback(self._errback, ori_errback=errback)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
316
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
317 def getEntitiesData(self, jids, keys, profile, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
318 d = self.root.callRemote("getEntitiesData", jids, keys, profile)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
319 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
320 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
321 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
322 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
323 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
324 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
325
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
326 def getEntityData(self, jid, keys, profile, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
327 d = self.root.callRemote("getEntityData", jid, keys, profile)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
328 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
329 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
330 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
331 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
332 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
333 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
334
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
335 def getFeatures(self, profile_key, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
336 d = self.root.callRemote("getFeatures", profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
337 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
338 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
339 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
340 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
341 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
342 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
343
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
344 def getMainResource(self, contact_jid, 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
345 d = self.root.callRemote("getMainResource", contact_jid, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
346 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
347 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
348 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
349 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
350 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
351 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
352
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
353 def getParamA(self, name, category, attribute="value", 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
354 d = self.root.callRemote("getParamA", name, category, attribute, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
355 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
356 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
357 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
358 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
359 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
360 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
361
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
362 def getParamsCategories(self, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
363 d = self.root.callRemote("getParamsCategories")
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
364 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
365 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
366 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
367 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
368 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
369 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
370
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
371 def getParamsUI(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@", callback=None, errback=None):
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
372 d = self.root.callRemote("getParamsUI", 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
373 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
374 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
375 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
376 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
377 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
378 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
379
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
380 def getPresenceStatuses(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
381 d = self.root.callRemote("getPresenceStatuses", profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
382 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
383 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
384 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
385 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
386 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
387 d.addErrback(self._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
388
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
389 def getReady(self, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
390 d = self.root.callRemote("getReady")
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
391 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
392 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
393 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
394 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
395 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
396 d.addErrback(self._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
397
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
398 def getVersion(self, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
399 d = self.root.callRemote("getVersion")
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
400 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
401 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
402 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
403 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
404 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
405 d.addErrback(self._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
406
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
407 def getWaitingSub(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
408 d = self.root.callRemote("getWaitingSub", profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
409 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
410 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
411 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
412 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
413 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
414 d.addErrback(self._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
415
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
416 def historyGet(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@", callback=None, errback=None):
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
417 d = self.root.callRemote("historyGet", 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
418 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
419 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
420 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
421 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
422 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
423 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
424
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
425 def imageCheck(self, arg_0, callback=None, errback=None):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
426 d = self.root.callRemote("imageCheck", arg_0)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
427 if callback is not None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
428 d.addCallback(callback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
429 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
430 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
431 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
432 d.addErrback(self._errback, ori_errback=errback)
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
433
3201
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
434 def imageGeneratePreview(self, image_path, profile_key, callback=None, errback=None):
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
435 d = self.root.callRemote("imageGeneratePreview", image_path, profile_key)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
436 if callback is not None:
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
437 d.addCallback(callback)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
438 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
439 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
440 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
441 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
442
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
443 def imageResize(self, image_path, width, height, callback=None, errback=None):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
444 d = self.root.callRemote("imageResize", image_path, width, height)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
445 if callback is not None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
446 d.addCallback(callback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
447 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
448 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
449 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
450 d.addErrback(self._errback, ori_errback=errback)
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
451
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
452 def isConnected(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
453 d = self.root.callRemote("isConnected", profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
454 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
455 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
456 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
457 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
458 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
459 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
460
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
461 def launchAction(self, callback_id, data, 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
462 d = self.root.callRemote("launchAction", callback_id, data, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
463 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
464 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
465 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
466 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
467 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
468 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
469
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
470 def loadParamsTemplate(self, filename, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
471 d = self.root.callRemote("loadParamsTemplate", filename)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
472 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
473 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
474 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
475 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
476 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
477 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
478
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
479 def menuHelpGet(self, menu_id, language, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
480 d = self.root.callRemote("menuHelpGet", menu_id, language)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
481 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
482 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
483 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
484 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
485 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
486 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
487
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
488 def menuLaunch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None):
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
489 d = self.root.callRemote("menuLaunch", 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
490 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
491 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
492 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
493 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
494 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
495 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
496
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
497 def menusGet(self, language, security_limit, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
498 d = self.root.callRemote("menusGet", language, security_limit)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
499 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
500 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
501 if errback is None:
3243
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
502 d.addErrback(self._generic_errback)
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
503 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
504 d.addErrback(self._errback, ori_errback=errback)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
505
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
506 def messageEncryptionGet(self, to_jid, profile_key, callback=None, errback=None):
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
507 d = self.root.callRemote("messageEncryptionGet", to_jid, profile_key)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
508 if callback is not None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
509 d.addCallback(callback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
510 if errback is None:
3243
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
511 d.addErrback(self._generic_errback)
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
512 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
513 d.addErrback(self._errback, ori_errback=errback)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
514
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
515 def messageEncryptionStart(self, to_jid, namespace='', replace=False, profile_key="@NONE@", callback=None, errback=None):
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
516 d = self.root.callRemote("messageEncryptionStart", to_jid, namespace, replace, profile_key)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
517 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
518 d.addCallback(lambda __: callback())
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
519 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
520 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
521 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
522 d.addErrback(self._errback, ori_errback=errback)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
523
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
524 def messageEncryptionStop(self, to_jid, profile_key, callback=None, errback=None):
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
525 d = self.root.callRemote("messageEncryptionStop", to_jid, profile_key)
2646
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
526 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
527 d.addCallback(lambda __: callback())
2646
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
528 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
529 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
530 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
531 d.addErrback(self._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
532
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
533 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
534 d = self.root.callRemote("messageSend", to_jid, message, subject, mess_type, extra, profile_key)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
535 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
536 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
537 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
538 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
539 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
540 d.addErrback(self._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
541
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
542 def namespacesGet(self, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
543 d = self.root.callRemote("namespacesGet")
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
544 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
545 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
546 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
547 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
548 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
549 d.addErrback(self._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
550
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
551 def paramsRegisterApp(self, xml, security_limit=-1, app='', 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
552 d = self.root.callRemote("paramsRegisterApp", xml, security_limit, app)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
553 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
554 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
555 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
556 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
557 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
558 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
559
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
560 def privateDataDelete(self, namespace, key, arg_2, callback=None, errback=None):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
561 d = self.root.callRemote("privateDataDelete", namespace, key, arg_2)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
562 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
563 d.addCallback(lambda __: callback())
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
564 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
565 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
566 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
567 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
568
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
569 def privateDataGet(self, namespace, key, profile_key, callback=None, errback=None):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
570 d = self.root.callRemote("privateDataGet", namespace, key, profile_key)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
571 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
572 d.addCallback(callback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
573 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
574 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
575 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
576 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
577
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
578 def privateDataSet(self, namespace, key, data, profile_key, callback=None, errback=None):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
579 d = self.root.callRemote("privateDataSet", namespace, key, data, profile_key)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
580 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
581 d.addCallback(lambda __: callback())
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
582 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
583 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
584 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
585 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
586
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
587 def profileCreate(self, profile, password='', component='', 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
588 d = self.root.callRemote("profileCreate", profile, password, component)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
589 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
590 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
591 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
592 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
593 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
594 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
595
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
596 def profileIsSessionStarted(self, 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
597 d = self.root.callRemote("profileIsSessionStarted", profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
598 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
599 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
600 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
601 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
602 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
603 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
604
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
605 def profileNameGet(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
606 d = self.root.callRemote("profileNameGet", profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
607 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
608 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
609 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
610 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
611 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
612 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
613
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
614 def profileSetDefault(self, profile, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
615 d = self.root.callRemote("profileSetDefault", profile)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
616 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
617 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
618 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
619 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
620 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
621 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
622
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
623 def profileStartSession(self, password='', 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
624 d = self.root.callRemote("profileStartSession", password, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
625 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
626 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
627 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
628 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
629 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
630 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
631
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
632 def profilesListGet(self, clients=True, components=False, 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
633 d = self.root.callRemote("profilesListGet", clients, components)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
634 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
635 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
636 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
637 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
638 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
639 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
640
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
641 def progressGet(self, id, profile, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
642 d = self.root.callRemote("progressGet", id, profile)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
643 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
644 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
645 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
646 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
647 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
648 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
649
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
650 def progressGetAll(self, profile, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
651 d = self.root.callRemote("progressGetAll", profile)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
652 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
653 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
654 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
655 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
656 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
657 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
658
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
659 def progressGetAllMetadata(self, profile, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
660 d = self.root.callRemote("progressGetAllMetadata", profile)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
661 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
662 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
663 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
664 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
665 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
666 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
667
2892
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
668 def rosterResync(self, profile_key="@DEFAULT@", callback=None, errback=None):
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
669 d = self.root.callRemote("rosterResync", profile_key)
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
670 if callback is not None:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
671 d.addCallback(lambda __: callback())
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
672 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
673 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
674 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
675 d.addErrback(self._errback, ori_errback=errback)
2892
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
676
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
677 def saveParamsTemplate(self, filename, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
678 d = self.root.callRemote("saveParamsTemplate", filename)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
679 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
680 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
681 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
682 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
683 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
684 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
685
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
686 def sessionInfosGet(self, profile_key, callback=None, errback=None):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
687 d = self.root.callRemote("sessionInfosGet", profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
688 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
689 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
690 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
691 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
692 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
693 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
694
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
695 def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
696 d = self.root.callRemote("setParam", 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
697 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
698 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
699 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
700 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
701 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
702 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
703
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
704 def setPresence(self, to_jid='', show='', statuses={}, 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
705 d = self.root.callRemote("setPresence", to_jid, show, statuses, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
706 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
707 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
708 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
709 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
710 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
711 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
712
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
713 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
714 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
715 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
716 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
717 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
718 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
719 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
720 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
721
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
722 def updateContact(self, entity_jid, name, groups, 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
723 d = self.root.callRemote("updateContact", entity_jid, name, groups, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
724 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
725 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
726 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
727 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
728 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
729 d.addErrback(self._errback, ori_errback=errback)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
730
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
731
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
732 class AIOSignalsHandler(SignalsHandler):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
733
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
734 def register_signal(self, name, handler, iface="core"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
735 async_handler = lambda *args, **kwargs: defer.Deferred.fromFuture(
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
736 asyncio.ensure_future(handler(*args, **kwargs)))
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
737 return super().register_signal(name, async_handler, iface)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
738
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
739
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
740 class AIOBridge(Bridge):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
741
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
742 def __init__(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
743 self.signals_handler = AIOSignalsHandler()
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
744
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
745 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
746 """Convert Failure to BridgeException"""
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
747 raise BridgeException(
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
748 name=failure_.type.decode('utf-8'),
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
749 message=str(failure_.value)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
750 )
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
751
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
752 def call(self, name, *args, **kwargs):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
753 d = self.root.callRemote(name, *args, *kwargs)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
754 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
755 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
756
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
757 async def bridgeConnect(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
758 d = super().bridgeConnect(callback=None, errback=None)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
759 return await d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
760
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
761 def actionsGet(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
762 d = self.root.callRemote("actionsGet", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
763 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
764 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
765
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
766 def addContact(self, entity_jid, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
767 d = self.root.callRemote("addContact", entity_jid, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
768 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
769 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
770
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
771 def asyncDeleteProfile(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
772 d = self.root.callRemote("asyncDeleteProfile", profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
773 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
774 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
775
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
776 def asyncGetParamA(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
777 d = self.root.callRemote("asyncGetParamA", name, category, attribute, security_limit, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
778 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
779 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
780
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
781 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"):
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
782 d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, app, extra, profile_key)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
783 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
784 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
785
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
786 def connect(self, profile_key="@DEFAULT@", password='', options={}):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
787 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
788 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
789 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
790
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
791 def delContact(self, entity_jid, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
792 d = self.root.callRemote("delContact", entity_jid, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
793 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
794 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
795
3206
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
796 def devicesInfosGet(self, bare_jid, profile_key):
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
797 d = self.root.callRemote("devicesInfosGet", bare_jid, profile_key)
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
798 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
799 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
800
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
801 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
802 d = self.root.callRemote("discoFindByFeatures", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
803 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
804 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
805
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
806 def discoInfos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
807 d = self.root.callRemote("discoInfos", entity_jid, node, use_cache, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
808 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
809 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
810
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
811 def discoItems(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
812 d = self.root.callRemote("discoItems", entity_jid, node, use_cache, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
813 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
814 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
815
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
816 def disconnect(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
817 d = self.root.callRemote("disconnect", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
818 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
819 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
820
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
821 def encryptionNamespaceGet(self, arg_0):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
822 d = self.root.callRemote("encryptionNamespaceGet", arg_0)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
823 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
824 return d.asFuture(asyncio.get_event_loop())
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 encryptionPluginsGet(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
827 d = self.root.callRemote("encryptionPluginsGet")
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
831 def encryptionTrustUIGet(self, to_jid, namespace, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
832 d = self.root.callRemote("encryptionTrustUIGet", to_jid, namespace, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
833 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
834 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
835
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
836 def getConfig(self, section, name):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
837 d = self.root.callRemote("getConfig", section, name)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
841 def getContacts(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
842 d = self.root.callRemote("getContacts", profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
846 def getContactsFromGroup(self, group, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
847 d = self.root.callRemote("getContactsFromGroup", group, profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
851 def getEntitiesData(self, jids, keys, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
852 d = self.root.callRemote("getEntitiesData", jids, keys, profile)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
856 def getEntityData(self, jid, keys, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
857 d = self.root.callRemote("getEntityData", jid, keys, profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
858 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
859 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
860
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
861 def getFeatures(self, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
862 d = self.root.callRemote("getFeatures", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
863 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
864 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
865
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
866 def getMainResource(self, contact_jid, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
867 d = self.root.callRemote("getMainResource", contact_jid, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
868 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
869 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
870
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
871 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
872 d = self.root.callRemote("getParamA", name, category, attribute, profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
876 def getParamsCategories(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
877 d = self.root.callRemote("getParamsCategories")
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
878 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
879 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
880
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
881 def getParamsUI(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@"):
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
882 d = self.root.callRemote("getParamsUI", security_limit, app, extra, profile_key)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
883 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
884 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
885
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
886 def getPresenceStatuses(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
887 d = self.root.callRemote("getPresenceStatuses", profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
891 def getReady(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
892 d = self.root.callRemote("getReady")
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
896 def getVersion(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
897 d = self.root.callRemote("getVersion")
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
898 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
899 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
900
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
901 def getWaitingSub(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
902 d = self.root.callRemote("getWaitingSub", profile_key)
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 historyGet(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
907 d = self.root.callRemote("historyGet", from_jid, to_jid, limit, between, filters, profile)
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
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
911 def imageCheck(self, arg_0):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
912 d = self.root.callRemote("imageCheck", arg_0)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
913 d.addErrback(self._errback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
914 return d.asFuture(asyncio.get_event_loop())
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
915
3201
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
916 def imageGeneratePreview(self, image_path, profile_key):
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
917 d = self.root.callRemote("imageGeneratePreview", image_path, profile_key)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
918 d.addErrback(self._errback)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
919 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
920
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
921 def imageResize(self, image_path, width, height):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
922 d = self.root.callRemote("imageResize", image_path, width, height)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
923 d.addErrback(self._errback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
924 return d.asFuture(asyncio.get_event_loop())
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
925
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
926 def isConnected(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
927 d = self.root.callRemote("isConnected", profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
931 def launchAction(self, callback_id, data, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
932 d = self.root.callRemote("launchAction", callback_id, data, profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
936 def loadParamsTemplate(self, filename):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
937 d = self.root.callRemote("loadParamsTemplate", filename)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
941 def menuHelpGet(self, menu_id, language):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
942 d = self.root.callRemote("menuHelpGet", menu_id, language)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
946 def menuLaunch(self, menu_type, path, data, security_limit, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
947 d = self.root.callRemote("menuLaunch", menu_type, path, data, security_limit, profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
951 def menusGet(self, language, security_limit):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
952 d = self.root.callRemote("menusGet", language, security_limit)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
956 def messageEncryptionGet(self, to_jid, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
957 d = self.root.callRemote("messageEncryptionGet", to_jid, profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
961 def messageEncryptionStart(self, to_jid, namespace='', replace=False, profile_key="@NONE@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
962 d = self.root.callRemote("messageEncryptionStart", to_jid, namespace, replace, profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
966 def messageEncryptionStop(self, to_jid, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
967 d = self.root.callRemote("messageEncryptionStop", to_jid, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
968 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
969 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
970
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
971 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
972 d = self.root.callRemote("messageSend", to_jid, message, subject, mess_type, extra, profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
976 def namespacesGet(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
977 d = self.root.callRemote("namespacesGet")
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
981 def paramsRegisterApp(self, xml, security_limit=-1, app=''):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
982 d = self.root.callRemote("paramsRegisterApp", xml, security_limit, app)
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
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
986 def privateDataDelete(self, namespace, key, arg_2):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
987 d = self.root.callRemote("privateDataDelete", namespace, key, arg_2)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
988 d.addErrback(self._errback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
989 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
990
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
991 def privateDataGet(self, namespace, key, profile_key):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
992 d = self.root.callRemote("privateDataGet", namespace, key, profile_key)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
993 d.addErrback(self._errback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
994 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
995
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
996 def privateDataSet(self, namespace, key, data, profile_key):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
997 d = self.root.callRemote("privateDataSet", namespace, key, data, profile_key)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
998 d.addErrback(self._errback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
999 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
1000
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1001 def profileCreate(self, profile, password='', component=''):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1002 d = self.root.callRemote("profileCreate", profile, password, component)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1003 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1004 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1005
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1006 def profileIsSessionStarted(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1007 d = self.root.callRemote("profileIsSessionStarted", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1008 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1009 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1010
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1011 def profileNameGet(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1012 d = self.root.callRemote("profileNameGet", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1013 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1014 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1015
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1016 def profileSetDefault(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1017 d = self.root.callRemote("profileSetDefault", profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1018 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1019 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1020
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1021 def profileStartSession(self, password='', profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1022 d = self.root.callRemote("profileStartSession", password, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1023 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1024 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1025
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1026 def profilesListGet(self, clients=True, components=False):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1027 d = self.root.callRemote("profilesListGet", clients, components)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1028 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1029 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1030
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1031 def progressGet(self, id, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1032 d = self.root.callRemote("progressGet", id, profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1033 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1034 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1035
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1036 def progressGetAll(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1037 d = self.root.callRemote("progressGetAll", profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1038 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1039 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1040
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1041 def progressGetAllMetadata(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1042 d = self.root.callRemote("progressGetAllMetadata", profile)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1046 def rosterResync(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1047 d = self.root.callRemote("rosterResync", profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1051 def saveParamsTemplate(self, filename):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1052 d = self.root.callRemote("saveParamsTemplate", filename)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1056 def sessionInfosGet(self, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1057 d = self.root.callRemote("sessionInfosGet", profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1061 def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1062 d = self.root.callRemote("setParam", name, value, category, security_limit, profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1066 def setPresence(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1067 d = self.root.callRemote("setPresence", to_jid, show, statuses, profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1071 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
1072 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
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1076 def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1077 d = self.root.callRemote("updateContact", entity_jid, name, groups, profile_key)
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())