Mercurial > libervia-backend
annotate sat_frontends/bridge/pb.py @ 2624:56f94936df1e
code style reformatting using black
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 27 Jun 2018 20:14:46 +0200 |
parents | 973d4551ffae |
children | 779351da2c13 |
rev | line source |
---|---|
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 #!/usr/bin/env python2 |
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 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
5 # Copyright (C) 2009-2018 Jérôme Poisson (goffi@goffi.org) |
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 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
20 from sat.core.log import getLogger |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
21 |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
22 log = getLogger(__name__) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
23 from sat.core import exceptions |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
24 from twisted.spread import pb |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
25 from twisted.internet import reactor |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
26 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
27 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
28 class SignalsHandler(pb.Referenceable): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
29 def __getattr__(self, name): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
30 if name.startswith("remote_"): |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
31 log.debug(u"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
|
32 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
|
33 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
34 else: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
35 raise AttributeError(name) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
36 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
37 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
|
38 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
|
39 method_name = "remote_" + name |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
40 try: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
41 self.__getattribute__(self, method_name) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
42 except AttributeError: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
43 pass |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
44 else: |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
45 raise exceptions.InternalError( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
46 u"{name} signal handler has been registered twice".format( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
47 name=method_name |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
48 ) |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
49 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
50 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
|
51 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
52 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
53 class Bridge(object): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
54 def __init__(self): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
55 self.signals_handler = SignalsHandler() |
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 def __getattr__(self, name): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
58 return lambda *args, **kwargs: self.call(name, args, kwargs) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
59 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
60 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
|
61 """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
|
62 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
63 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
|
64 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
|
65 @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
|
66 @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
|
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 None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
69 callback() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
70 else: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
71 callback(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 def call(self, name, args, kwargs): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
74 """call a remote method |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
75 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
76 @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
|
77 @param args(list): arguments |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
78 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
|
79 @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
|
80 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
|
81 """ |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
82 callback = errback = None |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
83 if kwargs: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
84 try: |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
85 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
|
86 except KeyError: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
87 pass |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
88 try: |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
89 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
|
90 except KeyError: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
91 pass |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
92 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
|
93 errback = args.pop() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
94 callback = args.pop() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
95 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
|
96 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
|
97 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
|
98 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
|
99 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
100 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
101 def _initBridgeEb(self, failure): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
102 log.error(u"Can't init bridge: {msg}".format(msg=failure)) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
103 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
104 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
|
105 """set remote root object |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
106 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
107 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
|
108 """ |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
109 self.root = root |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
110 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
|
111 d.addErrback(self._initBridgeEb) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
112 return d |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
113 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
114 def _generic_errback(self, failure): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
115 log.error(u"bridge failure: {}".format(failure)) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
116 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
117 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
|
118 factory = pb.PBClientFactory() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
119 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
|
120 d = factory.getRootObject() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
121 d.addCallback(self._set_root) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
122 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
123 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
124 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
125 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
|
126 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
|
127 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
128 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
|
129 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
|
130 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
|
131 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
132 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
133 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
134 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
135 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
136 def addContact( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
137 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
138 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
139 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
|
140 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
|
141 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
142 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
143 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
144 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
145 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
146 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
|
147 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
|
148 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
|
149 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
150 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
151 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
152 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
153 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
154 def asyncGetParamA( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
155 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
156 name, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
157 category, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
158 attribute="value", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
159 security_limit=-1, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
160 profile_key="@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
161 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
162 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
163 ): |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
164 d = self.root.callRemote( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
165 "asyncGetParamA", name, category, attribute, security_limit, profile_key |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
166 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
167 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
168 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
169 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
170 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
171 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
172 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
173 def asyncGetParamsValuesFromCategory( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
174 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
175 category, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
176 security_limit=-1, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
177 profile_key="@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
178 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
179 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
180 ): |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
181 d = self.root.callRemote( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
182 "asyncGetParamsValuesFromCategory", category, security_limit, profile_key |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
183 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
184 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
185 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
186 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
187 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
188 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
189 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
190 def connect( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
191 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
192 profile_key="@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
193 password="", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
194 options={}, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
195 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
196 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
197 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
198 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
|
199 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
|
200 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
201 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
202 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
203 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
204 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
205 def delContact( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
206 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
207 ): |
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("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
|
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(lambda dummy: 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 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
215 def discoFindByFeatures( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
216 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
217 namespaces, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
218 identities, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
219 bare_jid=False, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
220 service=True, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
221 roster=True, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
222 own_jid=True, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
223 local_device=False, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
224 profile_key=u"@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
225 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
226 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
227 ): |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
228 d = self.root.callRemote( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
229 "discoFindByFeatures", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
230 namespaces, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
231 identities, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
232 bare_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
233 service, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
234 roster, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
235 own_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
236 local_device, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
237 profile_key, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
238 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
239 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
|
240 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
241 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
242 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
243 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
244 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
245 def discoInfos( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
246 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
247 entity_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
248 node=u"", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
249 use_cache=True, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
250 profile_key=u"@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
251 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
252 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
253 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
254 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
|
255 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
|
256 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
257 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
258 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
259 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
260 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
261 def discoItems( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
262 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
263 entity_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
264 node=u"", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
265 use_cache=True, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
266 profile_key=u"@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
267 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
268 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
269 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
270 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
|
271 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
|
272 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
273 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
274 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
275 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
276 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
277 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
|
278 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
|
279 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
280 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
281 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
282 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
283 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
284 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
285 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
|
286 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
|
287 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
|
288 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
289 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
290 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
291 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
292 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
293 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
|
294 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
|
295 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
|
296 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
297 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
298 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
299 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
300 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
301 def getContactsFromGroup( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
302 self, group, profile_key="@DEFAULT@", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
303 ): |
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("getContactsFromGroup", group, 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 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
311 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
|
312 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
|
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 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
|
320 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
|
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 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
327 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
|
328 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
|
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 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
335 def getMainResource( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
336 self, contact_jid, profile_key="@DEFAULT@", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
337 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
338 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
|
339 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
|
340 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
341 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
342 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
343 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
344 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
345 def getParamA( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
346 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
347 name, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
348 category, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
349 attribute="value", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
350 profile_key="@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
351 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
352 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
353 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
354 d = self.root.callRemote("getParamA", name, category, attribute, profile_key) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
355 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
356 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
357 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
358 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
359 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
360 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
361 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
|
362 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
|
363 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
|
364 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
365 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
366 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
367 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
368 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
369 def getParamsUI( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
370 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
371 security_limit=-1, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
372 app="", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
373 profile_key="@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
374 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
375 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
376 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
377 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
|
378 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
|
379 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
380 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
381 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
382 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
383 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
384 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
|
385 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
|
386 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
|
387 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
388 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
389 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
390 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
391 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
392 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
|
393 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
|
394 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
|
395 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
396 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
397 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
398 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
399 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
400 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
|
401 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
|
402 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
403 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
404 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
405 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
406 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
407 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
408 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
|
409 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
|
410 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
411 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
412 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
413 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
414 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
415 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
416 def historyGet( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
417 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
418 from_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
419 to_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
420 limit, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
421 between=True, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
422 filters="", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
423 profile="@NONE@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
424 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
425 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
426 ): |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
427 d = self.root.callRemote( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
428 "historyGet", from_jid, to_jid, limit, between, filters, profile |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
429 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
430 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
|
431 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
432 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
433 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
434 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
435 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
436 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
|
437 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
|
438 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
|
439 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
440 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
441 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
442 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
443 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
444 def launchAction( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
445 self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
446 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
447 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
|
448 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
|
449 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
450 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
451 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
452 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
453 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
454 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
|
455 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
|
456 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
|
457 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
458 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
459 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
460 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
461 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
462 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
|
463 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
|
464 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
|
465 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
466 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
467 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
468 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
469 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
470 def menuLaunch( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
471 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
472 menu_type, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
473 path, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
474 data, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
475 security_limit, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
476 profile_key, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
477 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
478 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
479 ): |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
480 d = self.root.callRemote( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
481 "menuLaunch", menu_type, path, data, security_limit, profile_key |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
482 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
483 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
|
484 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
485 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
486 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
487 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
488 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
489 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
|
490 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
|
491 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
|
492 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
493 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
494 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
495 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
496 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
497 def messageSend( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
498 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
499 to_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
500 message, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
501 subject={}, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
502 mess_type="auto", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
503 extra={}, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
504 profile_key="@NONE@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
505 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
506 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
507 ): |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
508 d = self.root.callRemote( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
509 "messageSend", to_jid, message, subject, mess_type, extra, profile_key |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
510 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
511 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
|
512 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
513 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
514 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
515 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
516 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
517 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
|
518 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
|
519 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
|
520 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
521 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
522 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
523 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
524 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
525 def paramsRegisterApp( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
526 self, xml, security_limit=-1, app="", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
527 ): |
2579
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("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
|
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(lambda dummy: 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 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
535 def profileCreate( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
536 self, profile, password="", component="", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
537 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
538 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
|
539 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
|
540 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
541 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
542 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
543 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
544 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
545 def profileIsSessionStarted( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
546 self, profile_key="@DEFAULT@", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
547 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
548 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
|
549 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
|
550 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
551 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
552 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
553 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
554 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
555 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
|
556 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
|
557 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
|
558 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
559 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
560 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
561 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
562 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
563 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
|
564 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
|
565 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
|
566 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
567 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
568 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
569 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
570 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
571 def profileStartSession( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
572 self, password="", profile_key="@DEFAULT@", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
573 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
574 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
|
575 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
|
576 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
577 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
578 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
579 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
580 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
581 def profilesListGet( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
582 self, clients=True, components=False, callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
583 ): |
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("profilesListGet", clients, components) |
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: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
586 d.addCallback(callback) |
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 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
591 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
|
592 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
|
593 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
|
594 d.addCallback(callback) |
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) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
598 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
599 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
|
600 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
|
601 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
|
602 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
603 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
604 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
605 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
606 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
607 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
|
608 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
|
609 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
|
610 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
611 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
612 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
613 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
614 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
615 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
|
616 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
|
617 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
|
618 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
619 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
620 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
621 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
622 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
623 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
|
624 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
|
625 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
626 d.addCallback(callback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
627 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
628 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
629 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
630 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
631 def setParam( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
632 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
633 name, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
634 value, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
635 category, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
636 security_limit=-1, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
637 profile_key="@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
638 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
639 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
640 ): |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
641 d = self.root.callRemote( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
642 "setParam", name, value, category, security_limit, profile_key |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
643 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
644 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
|
645 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
646 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
647 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
648 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
649 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
650 def setPresence( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
651 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
652 to_jid="", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
653 show="", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
654 statuses={}, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
655 profile_key="@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
656 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
657 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
658 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
659 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
|
660 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
|
661 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
662 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
663 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
664 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
665 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
666 def subscription( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
667 self, sub_type, entity, profile_key="@DEFAULT@", callback=None, errback=None |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
668 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
669 d = self.root.callRemote("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
|
670 if callback is not None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
671 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
672 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
673 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
674 d.addErrback(errback) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
675 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
676 def updateContact( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
677 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
678 entity_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
679 name, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
680 groups, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
681 profile_key="@DEFAULT@", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
682 callback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
683 errback=None, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
684 ): |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
685 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
|
686 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
|
687 d.addCallback(lambda dummy: callback()) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
688 if errback is None: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
689 errback = self._generic_errback |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
690 d.addErrback(errback) |