annotate sat_frontends/bridge/pb.py @ 3039:a1bc34f90fa5

bridge (pb): implemented an asyncio compatible bridge: `pb` bridge can now be used with asyncio by instantiating AIOBridge.
author Goffi <goffi@goffi.org>
date Wed, 25 Sep 2019 08:53:38 +0200
parents ab2696e34d29
children 84bb63e1e4c4
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
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
2 # -*- coding: utf-8 -*-
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
3
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # SAT communication bridge
2771
003b8b4b56a7 date update
Goffi <goffi@goffi.org>
parents: 2765
diff changeset
5 # Copyright (C) 2009-2019 Jérôme Poisson (goffi@goffi.org)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
6
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # This program is free software: you can redistribute it and/or modify
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # (at your option) any later version.
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
11
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # GNU Affero General Public License for more details.
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
16
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
19
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
20 import asyncio
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
21 from functools import partial
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
22 from twisted.spread import pb
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
23 from twisted.internet import reactor, defer
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
24 from twisted.internet.error import ConnectionRefusedError
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
25 from logging import getLogger
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
26 from sat.core import exceptions
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
27 from sat_frontends.bridge.bridge_frontend import BridgeException
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
28
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
29 log = getLogger(__name__)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
30
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
31
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
32 class SignalsHandler(pb.Referenceable):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
33 def __getattr__(self, name):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
34 if name.startswith("remote_"):
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
35 log.debug("calling an unregistered signal: {name}".format(name=name[7:]))
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
36 return lambda *args, **kwargs: None
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
37
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
38 else:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
39 raise AttributeError(name)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
40
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
41 def register_signal(self, name, handler, iface="core"):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
42 log.debug("registering signal {name}".format(name=name))
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
43 method_name = "remote_" + name
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
44 try:
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
45 self.__getattribute__(method_name)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
46 except AttributeError:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
47 pass
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
48 else:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
49 raise exceptions.InternalError(
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
50 "{name} signal handler has been registered twice".format(
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
51 name=method_name
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
52 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
53 )
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
54 setattr(self, method_name, handler)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
55
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
56
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
57 class Bridge(object):
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
58
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
59 def __init__(self):
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
60 self.signals_handler = SignalsHandler()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
61
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
62 def __getattr__(self, name):
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
63 return partial(self.call, name)
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
64
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
65 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
66 """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
67
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
68 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
69 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
70 @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
71 @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
72 """
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
73 if result is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
74 callback()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
75 else:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
76 callback(result)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
77
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
78 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
79 """call a remote method
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 @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
82 @param args(list): arguments
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
83 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
84 @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
85 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
86 """
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
87 callback = errback = None
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
88 if kwargs:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
89 try:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
90 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
91 except KeyError:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
92 pass
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
93 try:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
94 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
95 except KeyError:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
96 pass
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
97 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
98 errback = args.pop()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
99 callback = args.pop()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
100 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
101 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
102 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
103 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
104 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
105
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
106 def _initBridgeEb(self, failure_):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
107 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
108 return failure_
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
109
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
110 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
111 """set remote root object
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
112
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
113 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
114 """
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
115 self.root = root
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
116 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
117 d.addErrback(self._initBridgeEb)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
118 return d
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
119
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
120 def getRootObjectEb(self, failure_):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
121 """Call errback with appropriate bridge error"""
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
122 if failure_.check(ConnectionRefusedError):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
123 raise exceptions.BridgeExceptionNoService
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
124 else:
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
125 raise failure_
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
126
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
127 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
128 factory = pb.PBClientFactory()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
129 reactor.connectTCP("localhost", 8789, factory)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
130 d = factory.getRootObject()
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
131 d.addCallback(self._set_root)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
132 if callback is not None:
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
133 d.addCallback(lambda __: callback())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
134 d.addErrback(self.getRootObjectEb)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
135 if errback is not None:
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
136 d.addErrback(lambda failure_: errback(failure_.value))
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
137 return d
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
138
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
139 def 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
140 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
141
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
142
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
143 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
144 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
145 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
146 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
147 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
148 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
149 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
150
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
151 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
152 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
153 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
154 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
155 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
156 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
157 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
158
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
159 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
160 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
161 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
162 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
163 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
164 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
165 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
166
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
167 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
168 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
169 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
170 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
171 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
172 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
173 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
174
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
175 def asyncGetParamsValuesFromCategory(self, 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
176 d = self.root.callRemote("asyncGetParamsValuesFromCategory", 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
177 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
178 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
179 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
180 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
181 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
182
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
183 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
184 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
185 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
186 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
187 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
188 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
189 d.addErrback(errback)
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 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
192 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
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:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
196 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
197 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
198
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
199 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
200 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
201 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
202 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
203 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
204 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
205 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
206
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
207 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
208 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
209 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
210 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
211 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
212 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
213 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
214
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
215 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
216 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
217 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
218 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
219 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
220 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
221 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
222
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
223 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
224 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
225 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
226 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
227 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
228 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
229 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
230
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
231 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
232 d = self.root.callRemote("encryptionNamespaceGet", arg_0)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
233 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
234 d.addCallback(callback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
235 if errback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
236 errback = self._generic_errback
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
237 d.addErrback(errback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
238
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
239 def encryptionPluginsGet(self, callback=None, errback=None):
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
240 d = self.root.callRemote("encryptionPluginsGet")
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
241 if callback is not None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
242 d.addCallback(callback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
243 if errback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
244 errback = self._generic_errback
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
245 d.addErrback(errback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
246
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
247 def encryptionTrustUIGet(self, to_jid, namespace, profile_key, callback=None, errback=None):
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
248 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
249 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
250 d.addCallback(callback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
251 if errback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
252 errback = self._generic_errback
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
253 d.addErrback(errback)
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
254
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
255 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
256 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
257 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
258 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
259 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
260 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
261 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
262
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
263 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
264 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
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:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
268 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
269 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
270
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
271 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
272 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
273 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
274 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
275 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
276 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
277 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
278
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
279 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
280 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
281 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
282 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
283 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
284 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
285 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
286
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
287 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
288 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
289 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
290 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
291 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
292 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
293 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
294
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
295 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
296 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
297 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
298 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
299 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
300 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
301 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
302
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
303 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
304 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
305 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
306 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
307 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
308 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
309 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
310
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
311 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
312 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
313 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
314 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
315 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
316 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
317 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
318
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
319 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
320 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
321 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
322 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
323 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
324 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
325 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
326
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
327 def getParamsUI(self, security_limit=-1, app='', 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
328 d = self.root.callRemote("getParamsUI", security_limit, app, profile_key)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
329 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
330 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
331 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
332 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
333 d.addErrback(errback)
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 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
336 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
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:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
340 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
341 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
342
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
343 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
344 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
345 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
346 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
347 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
348 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
349 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
350
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
351 def 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
352 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
353 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
354 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
355 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
356 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
357 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
358
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
359 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
360 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
361 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
362 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
363 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
364 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
365 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
366
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
367 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
368 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
369 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
370 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
371 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
372 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
373 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
374
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
375 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
376 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
377 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
378 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
379 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
380 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
381 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
382
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
383 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
384 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
385 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
386 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
387 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
388 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
389 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
390
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
391 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
392 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
393 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
394 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
395 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
396 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
397 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
398
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
399 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
400 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
401 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
402 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
403 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
404 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
405 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
406
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
407 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
408 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
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:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
412 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
413 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
414
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
415 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
416 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
417 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
418 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
419 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
420 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
421 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
422
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
423 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
424 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
425 if callback is not None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
426 d.addCallback(callback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
427 if errback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
428 errback = self._generic_errback
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
429 d.addErrback(errback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
430
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
431 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
432 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
433 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
434 d.addCallback(lambda __: callback())
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
435 if errback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
436 errback = self._generic_errback
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
437 d.addErrback(errback)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
438
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
439 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
440 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
441 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
442 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
443 if errback is None:
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
444 errback = self._generic_errback
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
445 d.addErrback(errback)
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
446
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
447 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
448 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
449 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
450 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
451 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
452 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
453 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
454
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
455 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
456 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
457 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
458 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
459 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
460 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
461 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
462
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
463 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
464 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
465 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
466 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
467 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
468 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
469 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
470
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
471 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
472 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
473 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
474 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
475 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
476 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
477 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
478
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
479 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
480 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
481 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
482 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
483 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
484 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
485 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
486
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
487 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
488 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
489 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
490 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
491 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
492 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
493 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
494
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
495 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
496 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
497 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
498 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
499 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
500 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
501 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
502
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
503 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
504 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
505 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
506 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
507 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
508 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
509 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
510
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
511 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
512 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
513 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
514 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
515 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
516 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
517 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
518
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
519 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
520 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
521 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
522 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
523 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
524 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
525 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
526
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
527 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
528 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
529 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
530 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
531 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
532 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
533 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
534
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
535 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
536 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
537 if callback is not None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
538 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
539 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
540 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
541 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
542
2892
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
543 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
544 d = self.root.callRemote("rosterResync", profile_key)
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
545 if callback is not None:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
546 d.addCallback(lambda __: callback())
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
547 if errback is None:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
548 errback = self._generic_errback
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
549 d.addErrback(errback)
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
550
2579
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
551 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
552 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
553 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
554 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
555 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
556 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
557 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
558
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
559 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
560 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
561 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
562 d.addCallback(callback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
563 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
564 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
565 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
566
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
567 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
568 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
569 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
570 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
571 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
572 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
573 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
574
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
575 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
576 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
577 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
578 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
579 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
580 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
581 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
582
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
583 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
584 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
585 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
586 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
587 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
588 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
589 d.addErrback(errback)
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
590
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
591 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
592 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
593 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
594 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
595 if errback is None:
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
596 errback = self._generic_errback
787b15d16347 bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff changeset
597 d.addErrback(errback)
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
598
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
599
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
600 class AIOSignalsHandler(SignalsHandler):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
601
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
602 def register_signal(self, name, handler, iface="core"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
603 async_handler = lambda *args, **kwargs: defer.Deferred.fromFuture(
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
604 asyncio.ensure_future(handler(*args, **kwargs)))
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
605 return super().register_signal(name, async_handler, iface)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
606
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
607
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
608 class AIOBridge(Bridge):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
609
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
610 def __init__(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
611 self.signals_handler = AIOSignalsHandler()
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
612
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
613 def _errback(self, failure_):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
614 raise BridgeException(
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
615 name=failure_.type.decode('utf-8'),
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
616 message=str(failure_.value)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
617 )
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
618
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
619 def call(self, name, *args, **kwargs):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
620 d = self.root.callRemote(name, *args, *kwargs)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
621 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
622 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
623
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
624 async def bridgeConnect(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
625 d = super().bridgeConnect(callback=None, errback=None)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
626 return await d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
627
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
628 def actionsGet(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
629 d = self.root.callRemote("actionsGet", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
630 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
631 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
632
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
633 def addContact(self, entity_jid, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
634 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
635 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
636 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
637
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
638 def asyncDeleteProfile(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
639 d = self.root.callRemote("asyncDeleteProfile", profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
640 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
641 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
642
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
643 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
644 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
645 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
646 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
647
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
648 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
649 d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
650 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
651 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
652
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
653 def connect(self, profile_key="@DEFAULT@", password='', options={}):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
654 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
655 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
656 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
657
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
658 def delContact(self, entity_jid, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
659 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
660 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
661 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
662
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
663 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
664 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
665 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
666 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
667
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
668 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
669 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
670 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
671 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
672
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
673 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
674 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
675 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
676 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
677
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
678 def disconnect(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
679 d = self.root.callRemote("disconnect", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
680 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
681 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
682
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
683 def encryptionNamespaceGet(self, arg_0):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
684 d = self.root.callRemote("encryptionNamespaceGet", arg_0)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
685 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
686 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
687
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
688 def encryptionPluginsGet(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
689 d = self.root.callRemote("encryptionPluginsGet")
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
690 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
691 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
692
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
693 def encryptionTrustUIGet(self, to_jid, namespace, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
694 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
695 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
696 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
697
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
698 def getConfig(self, section, name):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
699 d = self.root.callRemote("getConfig", section, name)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
700 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
701 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
702
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
703 def getContacts(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
704 d = self.root.callRemote("getContacts", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
705 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
706 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
707
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
708 def getContactsFromGroup(self, group, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
709 d = self.root.callRemote("getContactsFromGroup", group, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
710 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
711 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
712
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
713 def getEntitiesData(self, jids, keys, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
714 d = self.root.callRemote("getEntitiesData", jids, keys, profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
715 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
716 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
717
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
718 def getEntityData(self, jid, keys, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
719 d = self.root.callRemote("getEntityData", jid, keys, profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
720 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
721 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
722
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
723 def getFeatures(self, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
724 d = self.root.callRemote("getFeatures", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
725 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
726 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
727
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
728 def getMainResource(self, contact_jid, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
729 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
730 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
731 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
732
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
733 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
734 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
735 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
736 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
737
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
738 def getParamsCategories(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
739 d = self.root.callRemote("getParamsCategories")
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
740 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
741 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
742
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
743 def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
744 d = self.root.callRemote("getParamsUI", security_limit, app, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
745 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
746 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
747
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
748 def getPresenceStatuses(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
749 d = self.root.callRemote("getPresenceStatuses", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
750 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
751 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
752
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
753 def getReady(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
754 d = self.root.callRemote("getReady")
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
755 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
756 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
757
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
758 def getVersion(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
759 d = self.root.callRemote("getVersion")
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
760 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
761 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
762
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
763 def getWaitingSub(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
764 d = self.root.callRemote("getWaitingSub", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
765 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
766 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
767
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
768 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
769 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
770 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
771 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
772
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
773 def isConnected(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
774 d = self.root.callRemote("isConnected", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
775 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
776 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
777
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
778 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
779 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
780 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
781 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
782
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
783 def loadParamsTemplate(self, filename):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
784 d = self.root.callRemote("loadParamsTemplate", filename)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
785 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
786 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
787
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
788 def menuHelpGet(self, menu_id, language):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
789 d = self.root.callRemote("menuHelpGet", menu_id, language)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
790 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
791 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
792
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
793 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
794 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
795 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
796 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
797
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
798 def menusGet(self, language, security_limit):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
799 d = self.root.callRemote("menusGet", language, security_limit)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
800 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
801 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
802
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
803 def messageEncryptionGet(self, to_jid, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
804 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
805 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
806 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
807
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
808 def 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
809 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
810 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
811 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
812
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
813 def messageEncryptionStop(self, to_jid, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
814 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
815 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
816 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
817
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
818 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
819 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
820 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
821 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
822
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
823 def namespacesGet(self):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
824 d = self.root.callRemote("namespacesGet")
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
825 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
826 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
827
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
828 def paramsRegisterApp(self, xml, security_limit=-1, app=''):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
829 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
830 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
831 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
832
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
833 def profileCreate(self, profile, password='', component=''):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
834 d = self.root.callRemote("profileCreate", profile, password, component)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
835 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
836 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
837
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
838 def profileIsSessionStarted(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
839 d = self.root.callRemote("profileIsSessionStarted", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
840 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
841 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
842
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
843 def profileNameGet(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
844 d = self.root.callRemote("profileNameGet", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
845 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
846 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
847
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
848 def profileSetDefault(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
849 d = self.root.callRemote("profileSetDefault", profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
850 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
851 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
852
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
853 def profileStartSession(self, password='', profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
854 d = self.root.callRemote("profileStartSession", password, profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
855 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
856 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
857
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
858 def profilesListGet(self, clients=True, components=False):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
859 d = self.root.callRemote("profilesListGet", clients, components)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
860 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
861 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
862
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
863 def progressGet(self, id, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
864 d = self.root.callRemote("progressGet", id, profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
865 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
866 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
867
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
868 def progressGetAll(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
869 d = self.root.callRemote("progressGetAll", profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
870 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
871 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
872
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
873 def progressGetAllMetadata(self, profile):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
874 d = self.root.callRemote("progressGetAllMetadata", profile)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
875 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
876 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
877
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
878 def rosterResync(self, profile_key="@DEFAULT@"):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
879 d = self.root.callRemote("rosterResync", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
880 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
881 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
882
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
883 def saveParamsTemplate(self, filename):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
884 d = self.root.callRemote("saveParamsTemplate", filename)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
885 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
886 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
887
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
888 def sessionInfosGet(self, profile_key):
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
889 d = self.root.callRemote("sessionInfosGet", profile_key)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
890 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
891 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
892
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
893 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
894 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
895 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
896 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
897
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
898 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
899 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
900 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
901 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
902
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
903 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
904 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
905 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
906 return d.asFuture(asyncio.get_event_loop())
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
907
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
908 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
909 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
910 d.addErrback(self._errback)
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
911 return d.asFuture(asyncio.get_event_loop())