annotate sat_frontends/bridge/pb.py @ 3551:0ce37cf3fbf4

memory(sqlite): fix encoding when loading pickled data
author Goffi <goffi@goffi.org>
date Wed, 09 Jun 2021 10:01:56 +0200
parents d71a163c0861
children 3c7a64d6f49f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
1 #!/usr/bin/env python3
3137
559a625a236b fixed shebangs
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
2
3254
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
3 # SàT communication bridge
3479
be6d91572633 date update
Goffi <goffi@goffi.org>
parents: 3259
diff changeset
4 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
5
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # This program is free software: you can redistribute it and/or modify
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # it under the terms of the GNU Affero General Public License as published by
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # the Free Software Foundation, either version 3 of the License, or
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # (at your option) any later version.
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
10
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # This program is distributed in the hope that it will be useful,
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # GNU Affero General Public License for more details.
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
15
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
16 # You should have received a copy of the GNU Affero General Public License
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
18
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
19 import asyncio
3489
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
20 from logging import getLogger
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
21 from functools import partial
3489
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
22 from pathlib import Path
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
23 from twisted.spread import pb
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
24 from twisted.internet import reactor, defer
3489
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
25 from twisted.internet.error import ConnectionRefusedError, ConnectError
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
26 from sat.core import exceptions
3489
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
27 from sat.tools import config
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
28 from sat_frontends.bridge.bridge_frontend import BridgeException
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
29
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
30 log = getLogger(__name__)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
31
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
32
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
33 class SignalsHandler(pb.Referenceable):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
34 def __getattr__(self, name):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
35 if name.startswith("remote_"):
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
36 log.debug("calling an unregistered signal: {name}".format(name=name[7:]))
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
37 return lambda *args, **kwargs: None
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
38
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
39 else:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
40 raise AttributeError(name)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
41
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
42 def register_signal(self, name, handler, iface="core"):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
43 log.debug("registering signal {name}".format(name=name))
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
44 method_name = "remote_" + name
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
45 try:
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
46 self.__getattribute__(method_name)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
47 except AttributeError:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
48 pass
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
49 else:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
50 raise exceptions.InternalError(
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
51 "{name} signal handler has been registered twice".format(
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
52 name=method_name
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
53 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
54 )
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
55 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
56
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
57
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
58 class Bridge(object):
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
59
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
60 def __init__(self):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
61 self.signals_handler = SignalsHandler()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
62
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
63 def __getattr__(self, name):
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
64 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
65
3063
84bb63e1e4c4 bridge (pb): added missing _generic_errback
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
66 def _generic_errback(self, err):
84bb63e1e4c4 bridge (pb): added missing _generic_errback
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
67 log.error(f"bridge error: {err}")
84bb63e1e4c4 bridge (pb): added missing _generic_errback
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
68
3243
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
69 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
70 """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
71 ori_errback(
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
72 BridgeException(
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
73 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
74 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
75 )
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
76 )
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
77
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
78 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
79 """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
80
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
81 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
82 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
83 @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
84 @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
85 """
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
86 if result is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
87 callback()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
88 else:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
89 callback(result)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
90
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
91 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
92 """call a remote method
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
93
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
94 @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
95 @param args(list): arguments
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
96 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
97 @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
98 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
99 """
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
100 callback = errback = None
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
101 if kwargs:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
102 try:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
103 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
104 except KeyError:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
105 pass
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
106 try:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
107 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
108 except KeyError:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
109 pass
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
110 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
111 errback = args.pop()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
112 callback = args.pop()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
113 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
114 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
115 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
116 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
117 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
118
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
119 def _initBridgeEb(self, failure_):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
120 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
121 return failure_
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
122
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
123 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
124 """set remote root object
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
125
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
126 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
127 """
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
128 self.root = root
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
129 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
130 d.addErrback(self._initBridgeEb)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
131 return d
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
132
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
133 def getRootObjectEb(self, failure_):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
134 """Call errback with appropriate bridge error"""
3489
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
135 if failure_.check(ConnectionRefusedError, ConnectError):
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
136 raise exceptions.BridgeExceptionNoService
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
137 else:
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
138 raise failure_
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
139
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
140 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
141 factory = pb.PBClientFactory()
3489
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
142 conf = config.parseMainConf()
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
143 conn_type = config.getConfig(
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
144 conf,
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
145 "",
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
146 "bridge_pb_connection_type",
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
147 "unix_socket"
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
148 )
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
149 if conn_type == "unix_socket":
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
150 local_dir = Path(config.getConfig(conf, "", "local_dir")).resolve()
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
151 socket_path = local_dir / "bridge_pb"
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
152 reactor.connectUNIX(str(socket_path), factory)
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
153 elif conn_type == "socket":
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
154 host = int(config.getConfig(
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
155 conf,
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
156 "",
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
157 "bridge_pb_host",
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
158 "localhost"
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
159 ))
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
160 port = int(config.getConfig(
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
161 conf,
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
162 "",
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
163 "bridge_pb_port",
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
164 8789
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
165 ))
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
166 reactor.connectTCP(host, port, factory)
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
167 else:
d71a163c0861 bridge (pb): connection can be set to used either UNIX socket or TCP socket:
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
168 raise ValueError(f"Unknown pb connection type: {conn_type!r}")
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
169 d = factory.getRootObject()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
170 d.addCallback(self._set_root)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
171 if callback is not None:
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
172 d.addCallback(lambda __: callback())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
173 d.addErrback(self.getRootObjectEb)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
174 if errback is not None:
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
175 d.addErrback(lambda failure_: errback(failure_.value))
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
176 return d
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
177
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
178 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
179 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
180
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
181
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
182 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
183 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
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
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
191 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
192 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
193 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
194 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
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
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
200 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
201 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
202 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
203 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
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 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
210 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
211 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
212 d.addCallback(callback)
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
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
218 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
219 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
220 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
221 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
226
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
227 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
228 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
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
3254
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
236 def contactGet(self, arg_0, profile_key="@DEFAULT@", callback=None, errback=None):
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
237 d = self.root.callRemote("contactGet", arg_0, profile_key)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
238 if callback is not None:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
239 d.addCallback(callback)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
240 if errback is None:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
241 d.addErrback(self._generic_errback)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
242 else:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
243 d.addErrback(self._errback, ori_errback=errback)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
244
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
245 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
246 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
247 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
248 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
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
3206
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
254 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
255 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
256 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
257 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
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)
3206
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
262
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
263 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
264 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
265 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
266 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
271
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
272 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
273 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
274 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
275 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
280
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
281 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
282 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
283 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
284 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
289
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
290 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
291 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
292 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
293 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
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
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
299 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
300 d = self.root.callRemote("encryptionNamespaceGet", arg_0)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
301 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
302 d.addCallback(callback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
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)
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
307
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
308 def encryptionPluginsGet(self, callback=None, errback=None):
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
309 d = self.root.callRemote("encryptionPluginsGet")
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
310 if callback is not None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
311 d.addCallback(callback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
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)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
316
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
317 def encryptionTrustUIGet(self, to_jid, namespace, profile_key, callback=None, errback=None):
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
318 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
319 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
320 d.addCallback(callback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
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)
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
325
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
326 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
327 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
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 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
336 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
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 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
345 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
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
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
353 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
354 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
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 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
363 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
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
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
371 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
372 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
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
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
380 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
381 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
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
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
389 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
390 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
391 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
392 d.addCallback(callback)
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 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
399 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
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
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
407 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
408 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
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
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
416 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
417 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
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
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
425 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
426 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
427 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
428 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
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
433
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
434 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
435 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
436 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
437 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
442
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
443 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
444 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
445 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
446 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
451
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
452 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
453 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
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
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
461 def imageCheck(self, arg_0, callback=None, errback=None):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
462 d = self.root.callRemote("imageCheck", arg_0)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
463 if callback is not None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
464 d.addCallback(callback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
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)
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
469
3259
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
470 def imageConvert(self, source, dest, arg_2, extra, callback=None, errback=None):
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
471 d = self.root.callRemote("imageConvert", source, dest, arg_2, extra)
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
472 if callback is not None:
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
473 d.addCallback(callback)
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
474 if errback is None:
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
475 d.addErrback(self._generic_errback)
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
476 else:
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
477 d.addErrback(self._errback, ori_errback=errback)
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
478
3201
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
479 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
480 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
481 if callback is not None:
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
482 d.addCallback(callback)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
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)
3201
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
487
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
488 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
489 d = self.root.callRemote("imageResize", image_path, width, height)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
490 if callback is not None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
491 d.addCallback(callback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
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)
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
496
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
497 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
498 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
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
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
506 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
507 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
508 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
509 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
510 if errback is None:
3243
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
511 d.addErrback(self._generic_errback)
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
512 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
513 d.addErrback(self._errback, ori_errback=errback)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
514
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
515 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
516 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
517 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
518 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
523
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
524 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
525 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
526 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
527 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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 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
534 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
535 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
536 d.addCallback(callback)
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 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
543 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
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
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
551 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
552 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
553 if callback is not None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
554 d.addCallback(callback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
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)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
559
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
560 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
561 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
562 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
563 d.addCallback(lambda __: callback())
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
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)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
568
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
569 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
570 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
571 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
572 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
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)
2646
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
577
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
578 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
579 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
580 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
581 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
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
586
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
587 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
588 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
589 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
590 d.addCallback(callback)
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 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
597 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
598 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
599 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
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
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
605 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
606 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
607 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
608 d.addCallback(lambda __: callback())
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
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)
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
613
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
614 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
615 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
616 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
617 d.addCallback(callback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
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)
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
622
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
623 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
624 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
625 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
626 d.addCallback(lambda __: callback())
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
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)
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
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 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
633 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
634 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
635 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
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
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
641 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
642 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
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 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
651 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
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 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
660 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
661 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
662 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
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
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
668 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
669 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
670 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
671 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
676
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
677 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
678 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
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 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
687 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
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
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
695 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
696 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
697 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
698 d.addCallback(callback)
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
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
704 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
705 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
706 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
707 d.addCallback(callback)
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
2892
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
713 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
714 d = self.root.callRemote("rosterResync", profile_key)
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
715 if callback is not None:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
716 d.addCallback(lambda __: callback())
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
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)
2892
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
721
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
722 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
723 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
724 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
725 d.addCallback(callback)
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)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
730
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
731 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
732 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
733 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
734 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
735 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
736 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
737 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
738 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
739
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
740 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
741 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
742 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
743 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
744 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
745 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
746 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
747 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
748
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
749 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
750 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
751 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
752 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
753 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
754 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
755 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
756 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
757
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
758 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
759 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
760 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
761 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
762 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
763 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
764 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
765 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
766
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
767 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
768 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
769 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
770 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
771 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
772 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
773 else:
f2e30aa031e9 bridge (pb): fixed conversions of Failure to BridgeException in non-AIO bridge
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
774 d.addErrback(self._errback, ori_errback=errback)
3039
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
777 class AIOSignalsHandler(SignalsHandler):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
778
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
779 def register_signal(self, name, handler, iface="core"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
780 async_handler = lambda *args, **kwargs: defer.Deferred.fromFuture(
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
781 asyncio.ensure_future(handler(*args, **kwargs)))
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
782 return super().register_signal(name, async_handler, iface)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
783
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
784
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
785 class AIOBridge(Bridge):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
786
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
787 def __init__(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
788 self.signals_handler = AIOSignalsHandler()
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
789
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
790 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
791 """Convert Failure to BridgeException"""
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
792 raise BridgeException(
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
793 name=failure_.type.decode('utf-8'),
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
794 message=str(failure_.value)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
795 )
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
796
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
797 def call(self, name, *args, **kwargs):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
798 d = self.root.callRemote(name, *args, *kwargs)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
799 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
800 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
801
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
802 async def bridgeConnect(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
803 d = super().bridgeConnect(callback=None, errback=None)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
804 return await 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 actionsGet(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
807 d = self.root.callRemote("actionsGet", 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 addContact(self, entity_jid, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
812 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
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 asyncDeleteProfile(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
817 d = self.root.callRemote("asyncDeleteProfile", profile)
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 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
822 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
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
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
826 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
827 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
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 connect(self, profile_key="@DEFAULT@", password='', options={}):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
832 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
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
3254
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
836 def contactGet(self, arg_0, profile_key="@DEFAULT@"):
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
837 d = self.root.callRemote("contactGet", arg_0, profile_key)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
838 d.addErrback(self._errback)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
839 return d.asFuture(asyncio.get_event_loop())
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3243
diff changeset
840
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
841 def delContact(self, entity_jid, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
842 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
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
3206
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
846 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
847 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
848 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
849 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
850
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
851 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
852 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
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 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
857 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
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 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
862 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
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 disconnect(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
867 d = self.root.callRemote("disconnect", 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 encryptionNamespaceGet(self, arg_0):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
872 d = self.root.callRemote("encryptionNamespaceGet", arg_0)
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 encryptionPluginsGet(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
877 d = self.root.callRemote("encryptionPluginsGet")
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
881 def encryptionTrustUIGet(self, to_jid, namespace, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
882 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
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 getConfig(self, section, name):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
887 d = self.root.callRemote("getConfig", section, name)
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 getContacts(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
892 d = self.root.callRemote("getContacts", profile_key)
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 getContactsFromGroup(self, group, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
897 d = self.root.callRemote("getContactsFromGroup", group, profile_key)
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 getEntitiesData(self, jids, keys, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
902 d = self.root.callRemote("getEntitiesData", jids, keys, profile)
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 getEntityData(self, jid, keys, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
907 d = self.root.callRemote("getEntityData", jid, keys, 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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
911 def getFeatures(self, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
912 d = self.root.callRemote("getFeatures", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
913 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
914 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
915
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
916 def getMainResource(self, contact_jid, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
917 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
918 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
919 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
920
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
921 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
922 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
923 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
924 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
925
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
926 def getParamsCategories(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
927 d = self.root.callRemote("getParamsCategories")
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
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
931 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
932 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
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 getPresenceStatuses(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
937 d = self.root.callRemote("getPresenceStatuses", profile_key)
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 getReady(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
942 d = self.root.callRemote("getReady")
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 getVersion(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
947 d = self.root.callRemote("getVersion")
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 getWaitingSub(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
952 d = self.root.callRemote("getWaitingSub", profile_key)
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 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
957 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
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
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
961 def imageCheck(self, arg_0):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
962 d = self.root.callRemote("imageCheck", arg_0)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
963 d.addErrback(self._errback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
964 return d.asFuture(asyncio.get_event_loop())
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
965
3259
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
966 def imageConvert(self, source, dest, arg_2, extra):
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
967 d = self.root.callRemote("imageConvert", source, dest, arg_2, extra)
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
968 d.addErrback(self._errback)
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
969 return d.asFuture(asyncio.get_event_loop())
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
970
3201
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
971 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
972 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
973 d.addErrback(self._errback)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
974 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
975
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
976 def imageResize(self, image_path, width, height):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
977 d = self.root.callRemote("imageResize", image_path, width, height)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
978 d.addErrback(self._errback)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
979 return d.asFuture(asyncio.get_event_loop())
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3063
diff changeset
980
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
981 def isConnected(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
982 d = self.root.callRemote("isConnected", profile_key)
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
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
986 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
987 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
988 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
989 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
990
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
991 def loadParamsTemplate(self, filename):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
992 d = self.root.callRemote("loadParamsTemplate", filename)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
993 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
994 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
995
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
996 def menuHelpGet(self, menu_id, language):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
997 d = self.root.callRemote("menuHelpGet", menu_id, language)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
998 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
999 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1000
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1001 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
1002 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
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 menusGet(self, language, security_limit):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1007 d = self.root.callRemote("menusGet", language, security_limit)
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 messageEncryptionGet(self, to_jid, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1012 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
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 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
1017 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
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 messageEncryptionStop(self, to_jid, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1022 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
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 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
1027 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
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 namespacesGet(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1032 d = self.root.callRemote("namespacesGet")
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 paramsRegisterApp(self, xml, security_limit=-1, app=''):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1037 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
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
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
1041 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
1042 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
1043 d.addErrback(self._errback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
1044 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
1045
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
1046 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
1047 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
1048 d.addErrback(self._errback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
1049 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
1050
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
1051 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
1052 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
1053 d.addErrback(self._errback)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
1054 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
1055
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1056 def profileCreate(self, profile, password='', component=''):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1057 d = self.root.callRemote("profileCreate", profile, password, component)
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 profileIsSessionStarted(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1062 d = self.root.callRemote("profileIsSessionStarted", 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 profileNameGet(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1067 d = self.root.callRemote("profileNameGet", 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 profileSetDefault(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1072 d = self.root.callRemote("profileSetDefault", profile)
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 profileStartSession(self, password='', profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1077 d = self.root.callRemote("profileStartSession", password, 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())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1080
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1081 def profilesListGet(self, clients=True, components=False):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1082 d = self.root.callRemote("profilesListGet", clients, components)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1083 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1084 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1085
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1086 def progressGet(self, id, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1087 d = self.root.callRemote("progressGet", id, profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1088 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1089 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1090
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1091 def progressGetAll(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1092 d = self.root.callRemote("progressGetAll", profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1093 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1094 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1095
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1096 def progressGetAllMetadata(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1097 d = self.root.callRemote("progressGetAllMetadata", profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1098 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1099 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1100
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1101 def rosterResync(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1102 d = self.root.callRemote("rosterResync", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1103 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1104 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1105
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1106 def saveParamsTemplate(self, filename):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1107 d = self.root.callRemote("saveParamsTemplate", filename)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1108 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1109 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1110
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1111 def sessionInfosGet(self, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1112 d = self.root.callRemote("sessionInfosGet", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1113 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1114 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1115
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1116 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
1117 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
1118 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1119 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1120
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1121 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
1122 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
1123 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1124 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1125
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1126 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
1127 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
1128 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1129 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1130
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1131 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
1132 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
1133 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
1134 return d.asFuture(asyncio.get_event_loop())