Mercurial > libervia-backend
annotate sat/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 | 787b15d16347 |
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:
2579
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: a jabber client |
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 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
21 from sat.core.log import getLogger |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
22 |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
23 log = getLogger(__name__) |
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 jelly, 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 ## jelly hack |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
29 # we monkey patch jelly to handle namedtuple |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
30 ori_jelly = jelly._Jellier.jelly |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
31 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
32 |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
33 def fixed_jelly(self, obj): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
34 """this method fix handling of namedtuple""" |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
35 if isinstance(obj, tuple) and not obj is tuple: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
36 obj = tuple(obj) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
37 return ori_jelly(self, obj) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
38 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
39 |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
40 jelly._Jellier.jelly = fixed_jelly |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
41 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
42 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
43 class PBRoot(pb.Root): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
44 def __init__(self): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
45 self.signals_handlers = [] |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
46 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
47 def remote_initBridge(self, signals_handler): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
48 self.signals_handlers.append(signals_handler) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
49 log.info(u"registered signal handler") |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
50 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
51 def sendSignalEb(self, failure, signal_name): |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
52 log.error( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
53 u"Error while sending signal {name}: {msg}".format( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
54 name=signal_name, msg=failure |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
55 ) |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
56 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
57 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
58 def sendSignal(self, name, args, kwargs): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
59 to_remove = [] |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
60 for handler in self.signals_handlers: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
61 try: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
62 d = handler.callRemote(name, *args, **kwargs) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
63 except pb.DeadReferenceError: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
64 to_remove.append(handler) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
65 else: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
66 d.addErrback(self.sendSignalEb, name) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
67 if to_remove: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
68 for handler in to_remove: |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
69 log.debug(u"Removing signal handler for dead frontend") |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
70 self.signals_handlers.remove(handler) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
71 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
72 |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
73 ##METHODS_PART## |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
74 |
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 class Bridge(object): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
77 def __init__(self): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
78 log.info("Init Perspective Broker...") |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
79 self.root = PBRoot() |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
80 reactor.listenTCP(8789, pb.PBServerFactory(self.root)) |
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 def sendSignal(self, name, *args, **kwargs): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
83 self.root.sendSignal(name, args, kwargs) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
84 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
85 def remote_initBridge(self, signals_handler): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
86 self.signals_handlers.append(signals_handler) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
87 log.info(u"registered signal handler") |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
88 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
89 def register_method(self, name, callback): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
90 log.debug("registering PB bridge method [%s]" % name) |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
91 setattr(self.root, "remote_" + name, callback) |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
92 # self.root.register_method(name, callback) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
93 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
94 def addMethod(self, name, int_suffix, in_sign, out_sign, method, async=False, doc={}): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
95 """Dynamically add a method to PB Bridge""" |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
96 # FIXME: doc parameter is kept only temporary, the time to remove it from calls |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
97 log.debug("Adding method {name} to PB bridge".format(name=name)) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
98 self.register_method(name, method) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
99 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
100 def addSignal(self, name, int_suffix, signature, doc={}): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
101 log.debug("Adding signal {name} to PB bridge".format(name=name)) |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
102 setattr( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
103 self, name, lambda *args, **kwargs: self.sendSignal(name, *args, **kwargs) |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
104 ) |
2579
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
105 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
106 def actionNew(self, action_data, id, security_limit, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
107 self.sendSignal("actionNew", action_data, id, security_limit, profile) |
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 def connected(self, profile, jid_s): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
110 self.sendSignal("connected", profile, jid_s) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
111 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
112 def contactDeleted(self, entity_jid, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
113 self.sendSignal("contactDeleted", entity_jid, profile) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
114 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
115 def disconnected(self, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
116 self.sendSignal("disconnected", profile) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
117 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
118 def entityDataUpdated(self, jid, name, value, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
119 self.sendSignal("entityDataUpdated", jid, name, value, profile) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
120 |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
121 def messageNew( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
122 self, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
123 uid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
124 timestamp, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
125 from_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
126 to_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
127 message, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
128 subject, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
129 mess_type, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
130 extra, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
131 profile, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
132 ): |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
133 self.sendSignal( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
134 "messageNew", |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
135 uid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
136 timestamp, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
137 from_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
138 to_jid, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
139 message, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
140 subject, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
141 mess_type, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
142 extra, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
143 profile, |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2579
diff
changeset
|
144 ) |
2579
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 newContact(self, contact_jid, attributes, groups, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
147 self.sendSignal("newContact", contact_jid, attributes, groups, profile) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
148 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
149 def paramUpdate(self, name, value, category, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
150 self.sendSignal("paramUpdate", name, value, category, profile) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
151 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
152 def presenceUpdate(self, entity_jid, show, priority, statuses, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
153 self.sendSignal("presenceUpdate", entity_jid, show, priority, statuses, profile) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
154 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
155 def progressError(self, id, error, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
156 self.sendSignal("progressError", id, error, profile) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
157 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
158 def progressFinished(self, id, metadata, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
159 self.sendSignal("progressFinished", id, metadata, profile) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
160 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
161 def progressStarted(self, id, metadata, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
162 self.sendSignal("progressStarted", id, metadata, profile) |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
163 |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
164 def subscribe(self, sub_type, entity_jid, profile): |
787b15d16347
bridge: added generated pb files to repository (needed for Cagou on Android)
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
165 self.sendSignal("subscribe", sub_type, entity_jid, profile) |