annotate sat/bridge/dbus_bridge.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1934
2daf7b4c6756 use of /usr/bin/env instead of /usr/bin/python in shebang
Goffi <goffi@goffi.org>
parents: 1917
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 -*-
0
goffi@necton2
parents:
diff changeset
3
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
4 # SAT: a jabber client
2483
0046283a285d dates update
Goffi <goffi@goffi.org>
parents: 2443
diff changeset
5 # Copyright (C) 2009-2018 Jérôme Poisson (goffi@goffi.org)
0
goffi@necton2
parents:
diff changeset
6
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
7 # This program is free software: you can redistribute it and/or modify
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
10 # (at your option) any later version.
0
goffi@necton2
parents:
diff changeset
11
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
12 # This program is distributed in the hope that it will be useful,
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
15 # GNU Affero General Public License for more details.
0
goffi@necton2
parents:
diff changeset
16
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
0
goffi@necton2
parents:
diff changeset
19
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
20 from sat.core.i18n import _
0
goffi@necton2
parents:
diff changeset
21 import dbus
goffi@necton2
parents:
diff changeset
22 import dbus.service
goffi@necton2
parents:
diff changeset
23 import dbus.mainloop.glib
468
c97640c90a94 D-Bus Bridge: use inspection to name attribute + fix asynchronous calls for dynamically added method, it now use deferred return value instead of callback/errback attributes
Goffi <goffi@goffi.org>
parents: 459
diff changeset
24 import inspect
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
25 from sat.core.log import getLogger
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
26
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
27 log = getLogger(__name__)
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
28 from twisted.internet.defer import Deferred
627
d207c2186519 core, bridge, jp, quick_frontend: SàT stop more gracefully if bridge can't be initialised:
Goffi <goffi@goffi.org>
parents: 609
diff changeset
29 from sat.core.exceptions import BridgeInitError
0
goffi@necton2
parents:
diff changeset
30
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
31 const_INT_PREFIX = "org.goffi.SAT" # Interface prefix
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
32 const_ERROR_PREFIX = const_INT_PREFIX + ".error"
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
33 const_OBJ_PATH = "/org/goffi/SAT/bridge"
371
3ea41a199b36 bridge refactoring: categories are now core and plugin instead of communication and request
Goffi <goffi@goffi.org>
parents: 365
diff changeset
34 const_CORE_SUFFIX = ".core"
3ea41a199b36 bridge refactoring: categories are now core and plugin instead of communication and request
Goffi <goffi@goffi.org>
parents: 365
diff changeset
35 const_PLUGIN_SUFFIX = ".plugin"
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
36
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
37
477
031b0e0aaab8 plugin groupblog: subscriptions/notifications
Goffi <goffi@goffi.org>
parents: 469
diff changeset
38 class ParseError(Exception):
031b0e0aaab8 plugin groupblog: subscriptions/notifications
Goffi <goffi@goffi.org>
parents: 469
diff changeset
39 pass
031b0e0aaab8 plugin groupblog: subscriptions/notifications
Goffi <goffi@goffi.org>
parents: 469
diff changeset
40
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
41
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
42 class MethodNotRegistered(dbus.DBusException):
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
43 _dbus_error_name = const_ERROR_PREFIX + ".MethodNotRegistered"
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
44
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
45
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
46 class InternalError(dbus.DBusException):
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
47 _dbus_error_name = const_ERROR_PREFIX + ".InternalError"
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
48
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
49
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
50 class AsyncNotDeferred(dbus.DBusException):
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
51 _dbus_error_name = const_ERROR_PREFIX + ".AsyncNotDeferred"
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
52
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
53
424
72c13313b6d6 bridge: added check that synchronous method does not return a deferred
Goffi <goffi@goffi.org>
parents: 423
diff changeset
54 class DeferredNotAsync(dbus.DBusException):
72c13313b6d6 bridge: added check that synchronous method does not return a deferred
Goffi <goffi@goffi.org>
parents: 423
diff changeset
55 _dbus_error_name = const_ERROR_PREFIX + ".DeferredNotAsync"
72c13313b6d6 bridge: added check that synchronous method does not return a deferred
Goffi <goffi@goffi.org>
parents: 423
diff changeset
56
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
57
419
6c167a2e04b8 bridge: added generic D-Bus exception management + asyncCreateProfile method
Goffi <goffi@goffi.org>
parents: 413
diff changeset
58 class GenericException(dbus.DBusException):
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
59 def __init__(self, twisted_error):
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
60 """
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
61
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
62 @param twisted_error (Failure): instance of twisted Failure
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
63 @return: DBusException
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
64 """
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
65 super(GenericException, self).__init__()
751
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
66 try:
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
67 # twisted_error.value is a class
1062
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1060
diff changeset
68 class_ = twisted_error.value().__class__
751
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
69 except TypeError:
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
70 # twisted_error.value is an instance
1062
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1060
diff changeset
71 class_ = twisted_error.value.__class__
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
72 message = twisted_error.getErrorMessage()
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
73 try:
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
74 self.args = (message, twisted_error.value.condition)
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
75 except AttributeError:
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
76 self.args = (message,)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
77 self._dbus_error_name = ".".join(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
78 [const_ERROR_PREFIX, class_.__module__, class_.__name__]
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
79 )
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
80
419
6c167a2e04b8 bridge: added generic D-Bus exception management + asyncCreateProfile method
Goffi <goffi@goffi.org>
parents: 413
diff changeset
81
0
goffi@necton2
parents:
diff changeset
82 class DbusObject(dbus.service.Object):
goffi@necton2
parents:
diff changeset
83 def __init__(self, bus, path):
goffi@necton2
parents:
diff changeset
84 dbus.service.Object.__init__(self, bus, path)
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
85 log.debug("Init DbusObject...")
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
86 self.cb = {}
0
goffi@necton2
parents:
diff changeset
87
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
88 def register_method(self, name, cb):
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
89 self.cb[name] = cb
0
goffi@necton2
parents:
diff changeset
90
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
91 def _callback(self, name, *args, **kwargs):
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
92 """call the callback if it exists, raise an exception else
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
93 if the callback return a deferred, use async methods"""
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
94 if not name in self.cb:
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
95 raise MethodNotRegistered
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
96
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
97 if "callback" in kwargs:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
98 # we must have errback too
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
99 if not "errback" in kwargs:
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
100 log.error("errback is missing in method call [%s]" % name)
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
101 raise InternalError
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
102 callback = kwargs.pop("callback")
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
103 errback = kwargs.pop("errback")
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
104 async = True
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
105 else:
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
106 async = False
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
107 result = self.cb[name](*args, **kwargs)
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
108 if async:
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
109 if not isinstance(result, Deferred):
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
110 log.error("Asynchronous method [%s] does not return a Deferred." % name)
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
111 raise AsyncNotDeferred
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
112 result.addCallback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
113 lambda result: callback() if result is None else callback(result)
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
114 )
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
115 result.addErrback(lambda err: errback(GenericException(err)))
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
116 else:
424
72c13313b6d6 bridge: added check that synchronous method does not return a deferred
Goffi <goffi@goffi.org>
parents: 423
diff changeset
117 if isinstance(result, Deferred):
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
118 log.error("Synchronous method [%s] return a Deferred." % name)
424
72c13313b6d6 bridge: added check that synchronous method does not return a deferred
Goffi <goffi@goffi.org>
parents: 423
diff changeset
119 raise DeferredNotAsync
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
120 return result
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
121
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
122 ### signals ###
0
goffi@necton2
parents:
diff changeset
123
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
124 @dbus.service.signal(const_INT_PREFIX + const_PLUGIN_SUFFIX, signature="")
371
3ea41a199b36 bridge refactoring: categories are now core and plugin instead of communication and request
Goffi <goffi@goffi.org>
parents: 365
diff changeset
125 def dummySignal(self):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
126 # FIXME: workaround for addSignal (doesn't work if one method doensn't
371
3ea41a199b36 bridge refactoring: categories are now core and plugin instead of communication and request
Goffi <goffi@goffi.org>
parents: 365
diff changeset
127 # already exist for plugins), probably missing some initialisation, need
3ea41a199b36 bridge refactoring: categories are now core and plugin instead of communication and request
Goffi <goffi@goffi.org>
parents: 365
diff changeset
128 # further investigations
3ea41a199b36 bridge refactoring: categories are now core and plugin instead of communication and request
Goffi <goffi@goffi.org>
parents: 365
diff changeset
129 pass
3ea41a199b36 bridge refactoring: categories are now core and plugin instead of communication and request
Goffi <goffi@goffi.org>
parents: 365
diff changeset
130
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
131 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="a{ss}sis")
1599
e2ed8009e66e backend, bridge, frontends: actionNew has now a security_limit argument + added some docstring to explain data argument
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
132 def actionNew(self, action_data, id, security_limit, profile):
1467
ceba6fd77739 core, bridge: new signal actionNew to launch an action from the backend (e.g. display a dialog message):
Goffi <goffi@goffi.org>
parents: 1435
diff changeset
133 pass
ceba6fd77739 core, bridge: new signal actionNew to launch an action from the backend (e.g. display a dialog message):
Goffi <goffi@goffi.org>
parents: 1435
diff changeset
134
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
135 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ss")
1435
7590bbf44eed bridge, quick_frontend: the JID that is assigned by the server can differ from the one we asked for (resource)
souliane <souliane@mailoo.org>
parents: 1414
diff changeset
136 def connected(self, profile, jid_s):
336
953536246d9d core: added email in registerNewAccount
Goffi <goffi@goffi.org>
parents: 300
diff changeset
137 pass
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
138
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
139 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ss")
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
140 def contactDeleted(self, entity_jid, profile):
336
953536246d9d core: added email in registerNewAccount
Goffi <goffi@goffi.org>
parents: 300
diff changeset
141 pass
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
142
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
143 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="s")
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
144 def disconnected(self, profile):
336
953536246d9d core: added email in registerNewAccount
Goffi <goffi@goffi.org>
parents: 300
diff changeset
145 pass
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
146
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
147 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ssss")
504
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
148 def entityDataUpdated(self, jid, name, value, profile):
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
149 pass
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
150
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
151 @dbus.service.signal(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
152 const_INT_PREFIX + const_CORE_SUFFIX, signature="sdssa{ss}a{ss}sa{ss}s"
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
153 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
154 def messageNew(
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 uid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
157 timestamp,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
158 from_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
159 to_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
160 message,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
161 subject,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
162 mess_type,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
163 extra,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
164 profile,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
165 ):
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
166 pass
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
167
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
168 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sa{ss}ass")
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
169 def newContact(self, contact_jid, attributes, groups, profile):
336
953536246d9d core: added email in registerNewAccount
Goffi <goffi@goffi.org>
parents: 300
diff changeset
170 pass
0
goffi@necton2
parents:
diff changeset
171
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
172 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ssss")
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
173 def paramUpdate(self, name, value, category, profile):
336
953536246d9d core: added email in registerNewAccount
Goffi <goffi@goffi.org>
parents: 300
diff changeset
174 pass
0
goffi@necton2
parents:
diff changeset
175
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
176 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="ssia{ss}s")
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
177 def presenceUpdate(self, entity_jid, show, priority, statuses, profile):
336
953536246d9d core: added email in registerNewAccount
Goffi <goffi@goffi.org>
parents: 300
diff changeset
178 pass
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
179
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
180 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sss")
1917
05a5a125a238 bridge (frontend): raise a BridgeExceptionNoService on org.freedesktop.DBus.Error.Spawn.ExecFailed D-Bus error
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
181 def progressError(self, id, error, profile):
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
182 pass
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
183
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
184 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sa{ss}s")
1626
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
185 def progressFinished(self, id, metadata, profile):
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
186 pass
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
187
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
188 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sa{ss}s")
1626
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
189 def progressStarted(self, id, metadata, profile):
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
190 pass
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
191
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
192 @dbus.service.signal(const_INT_PREFIX + const_CORE_SUFFIX, signature="sss")
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
193 def subscribe(self, sub_type, entity_jid, profile):
336
953536246d9d core: added email in registerNewAccount
Goffi <goffi@goffi.org>
parents: 300
diff changeset
194 pass
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
195
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
196 ### methods ###
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
197
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
198 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
199 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
200 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
201 out_signature="a(a{ss}si)",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
202 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
203 )
1622
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1599
diff changeset
204 def actionsGet(self, profile_key="@DEFAULT@"):
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1599
diff changeset
205 return self._callback("actionsGet", unicode(profile_key))
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1599
diff changeset
206
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
207 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
208 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
209 in_signature="ss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
210 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
211 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
212 )
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
213 def addContact(self, entity_jid, profile_key="@DEFAULT@"):
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
214 return self._callback("addContact", unicode(entity_jid), unicode(profile_key))
0
goffi@necton2
parents:
diff changeset
215
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
216 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
217 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
218 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
219 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
220 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
221 )
893
308a96bc7c1b core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile
souliane <souliane@mailoo.org>
parents: 811
diff changeset
222 def asyncDeleteProfile(self, profile, callback=None, errback=None):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
223 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
224 "asyncDeleteProfile", unicode(profile), callback=callback, errback=errback
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
225 )
893
308a96bc7c1b core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile
souliane <souliane@mailoo.org>
parents: 811
diff changeset
226
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
227 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
228 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
229 in_signature="sssis",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
230 out_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
231 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
232 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
233 def asyncGetParamA(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
234 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
235 name,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
236 category,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
237 attribute="value",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
238 security_limit=-1,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
239 profile_key="@DEFAULT@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
240 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
241 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
242 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
243 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
244 "asyncGetParamA",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
245 unicode(name),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
246 unicode(category),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
247 unicode(attribute),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
248 security_limit,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
249 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
250 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
251 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
252 )
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 399
diff changeset
253
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
254 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
255 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
256 in_signature="sis",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
257 out_signature="a{ss}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
258 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
259 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
260 def asyncGetParamsValuesFromCategory(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
261 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
262 category,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
263 security_limit=-1,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
264 profile_key="@DEFAULT@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
265 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
266 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
267 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
268 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
269 "asyncGetParamsValuesFromCategory",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
270 unicode(category),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
271 security_limit,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
272 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
273 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
274 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
275 )
1587
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
276
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
277 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
278 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
279 in_signature="ssa{ss}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
280 out_signature="b",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
281 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
282 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
283 def connect(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
284 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
285 profile_key="@DEFAULT@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
286 password="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
287 options={},
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
288 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
289 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
290 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
291 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
292 "connect",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
293 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
294 unicode(password),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
295 options,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
296 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
297 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
298 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
299
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
300 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
301 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
302 in_signature="ss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
303 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
304 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
305 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
306 def delContact(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
307 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
308 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
309 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
310 "delContact",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
311 unicode(entity_jid),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
312 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
313 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
314 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
315 )
2142
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
316
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
317 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
318 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
319 in_signature="asa(ss)bbbbbs",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
320 out_signature="(a{sa(sss)}a{sa(sss)}a{sa(sss)})",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
321 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
322 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
323 def discoFindByFeatures(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
324 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
325 namespaces,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
326 identities,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
327 bare_jid=False,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
328 service=True,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
329 roster=True,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
330 own_jid=True,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
331 local_device=False,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
332 profile_key=u"@DEFAULT@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
333 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
334 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
335 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
336 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
337 "discoFindByFeatures",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
338 namespaces,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
339 identities,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
340 bare_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
341 service,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
342 roster,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
343 own_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
344 local_device,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
345 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
346 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
347 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
348 )
2534
7da86e1633a5 core: new discoFindFeatures method which return all server services/roster entities implementing a set of features.
Goffi <goffi@goffi.org>
parents: 2483
diff changeset
349
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
350 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
351 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
352 in_signature="ssbs",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
353 out_signature="(asa(sss)a{sa(a{ss}as)})",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
354 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
355 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
356 def discoInfos(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
357 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
358 entity_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
359 node=u"",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
360 use_cache=True,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
361 profile_key=u"@DEFAULT@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
362 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
363 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
364 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
365 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
366 "discoInfos",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
367 unicode(entity_jid),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
368 unicode(node),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
369 use_cache,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
370 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
371 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
372 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
373 )
963
723f28cd15c7 core (disco): added discoInfos and discoItems bridge methods
Goffi <goffi@goffi.org>
parents: 943
diff changeset
374
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
375 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
376 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
377 in_signature="ssbs",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
378 out_signature="a(sss)",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
379 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
380 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
381 def discoItems(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
382 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
383 entity_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
384 node=u"",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
385 use_cache=True,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
386 profile_key=u"@DEFAULT@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
387 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
388 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
389 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
390 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
391 "discoItems",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
392 unicode(entity_jid),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
393 unicode(node),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
394 use_cache,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
395 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
396 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
397 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
398 )
963
723f28cd15c7 core (disco): added discoInfos and discoItems bridge methods
Goffi <goffi@goffi.org>
parents: 943
diff changeset
399
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
400 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
401 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
402 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
403 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
404 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
405 )
2144
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
406 def disconnect(self, profile_key="@DEFAULT@", callback=None, errback=None):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
407 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
408 "disconnect", unicode(profile_key), callback=callback, errback=errback
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
409 )
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
410
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
411 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
412 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
413 in_signature="ss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
414 out_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
415 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
416 )
365
efbfccfed623 core: local_dir moved to config file
Goffi <goffi@goffi.org>
parents: 364
diff changeset
417 def getConfig(self, section, name):
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
418 return self._callback("getConfig", unicode(section), unicode(name))
364
312ca6f9d84a core: configuration file
Goffi <goffi@goffi.org>
parents: 360
diff changeset
419
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
420 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
421 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
422 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
423 out_signature="a(sa{ss}as)",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
424 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
425 )
1262
f8a8434dbac7 core: improved roster management + misc:
Goffi <goffi@goffi.org>
parents: 1224
diff changeset
426 def getContacts(self, profile_key="@DEFAULT@", callback=None, errback=None):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
427 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
428 "getContacts", unicode(profile_key), callback=callback, errback=errback
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
429 )
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
430
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
431 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
432 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
433 in_signature="ss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
434 out_signature="as",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
435 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
436 )
501
e9634d2e7b38 core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
Goffi <goffi@goffi.org>
parents: 480
diff changeset
437 def getContactsFromGroup(self, group, profile_key="@DEFAULT@"):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
438 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
439 "getContactsFromGroup", unicode(group), unicode(profile_key)
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
440 )
501
e9634d2e7b38 core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
Goffi <goffi@goffi.org>
parents: 480
diff changeset
441
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
442 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
443 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
444 in_signature="asass",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
445 out_signature="a{sa{ss}}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
446 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
447 )
1314
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
448 def getEntitiesData(self, jids, keys, profile):
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
449 return self._callback("getEntitiesData", jids, keys, unicode(profile))
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
450
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
451 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
452 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
453 in_signature="sass",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
454 out_signature="a{ss}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
455 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
456 )
504
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
457 def getEntityData(self, jid, keys, profile):
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
458 return self._callback("getEntityData", unicode(jid), keys, unicode(profile))
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
459
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
460 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
461 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
462 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
463 out_signature="a{sa{ss}}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
464 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
465 )
1482
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1467
diff changeset
466 def getFeatures(self, profile_key, callback=None, errback=None):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
467 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
468 "getFeatures", unicode(profile_key), callback=callback, errback=errback
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
469 )
1482
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1467
diff changeset
470
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
471 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
472 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
473 in_signature="ss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
474 out_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
475 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
476 )
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1262
diff changeset
477 def getMainResource(self, contact_jid, profile_key="@DEFAULT@"):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
478 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
479 "getMainResource", unicode(contact_jid), unicode(profile_key)
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
480 )
399
3ed53803b3b3 core: added getLastResource method
Goffi <goffi@goffi.org>
parents: 387
diff changeset
481
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
482 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
483 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
484 in_signature="ssss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
485 out_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
486 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
487 )
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
488 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
489 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
490 "getParamA",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
491 unicode(name),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
492 unicode(category),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
493 unicode(attribute),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
494 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
495 )
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
496
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
497 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
498 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
499 in_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
500 out_signature="as",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
501 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
502 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
503 def getParamsCategories(self,):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
504 return self._callback("getParamsCategories")
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
505
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
506 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
507 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
508 in_signature="iss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
509 out_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
510 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
511 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
512 def getParamsUI(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
513 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
514 security_limit=-1,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
515 app="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
516 profile_key="@DEFAULT@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
517 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
518 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
519 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
520 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
521 "getParamsUI",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
522 security_limit,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
523 unicode(app),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
524 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
525 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
526 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
527 )
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
528
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
529 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
530 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
531 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
532 out_signature="a{sa{s(sia{ss})}}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
533 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
534 )
943
71926ec2114d core (memory): entities cache improvments:
Goffi <goffi@goffi.org>
parents: 917
diff changeset
535 def getPresenceStatuses(self, profile_key="@DEFAULT@"):
71926ec2114d core (memory): entities cache improvments:
Goffi <goffi@goffi.org>
parents: 917
diff changeset
536 return self._callback("getPresenceStatuses", unicode(profile_key))
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
537
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
538 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
539 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
540 in_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
541 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
542 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
543 )
1023
8bae81e254a2 core: added a getReady method which can be called by frontends to ensure that backend is fully initialised before doing anything + this ckeck is automatically done in asyncConnect
Goffi <goffi@goffi.org>
parents: 1015
diff changeset
544 def getReady(self, callback=None, errback=None):
8bae81e254a2 core: added a getReady method which can be called by frontends to ensure that backend is fully initialised before doing anything + this ckeck is automatically done in asyncConnect
Goffi <goffi@goffi.org>
parents: 1015
diff changeset
545 return self._callback("getReady", callback=callback, errback=errback)
8bae81e254a2 core: added a getReady method which can be called by frontends to ensure that backend is fully initialised before doing anything + this ckeck is automatically done in asyncConnect
Goffi <goffi@goffi.org>
parents: 1015
diff changeset
546
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
547 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
548 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
549 in_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
550 out_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
551 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
552 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
553 def getVersion(self,):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
554 return self._callback("getVersion")
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
555
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
556 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
557 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
558 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
559 out_signature="a{ss}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
560 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
561 )
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
562 def getWaitingSub(self, profile_key="@DEFAULT@"):
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
563 return self._callback("getWaitingSub", unicode(profile_key))
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
564
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
565 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
566 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
567 in_signature="ssiba{ss}s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
568 out_signature="a(sdssa{ss}a{ss}sa{ss})",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
569 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
570 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
571 def historyGet(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
572 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
573 from_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
574 to_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
575 limit,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
576 between=True,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
577 filters="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
578 profile="@NONE@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
579 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
580 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
581 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
582 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
583 "historyGet",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
584 unicode(from_jid),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
585 unicode(to_jid),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
586 limit,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
587 between,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
588 filters,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
589 unicode(profile),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
590 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
591 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
592 )
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
593
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
594 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
595 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
596 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
597 out_signature="b",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
598 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
599 )
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
600 def isConnected(self, profile_key="@DEFAULT@"):
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
601 return self._callback("isConnected", unicode(profile_key))
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
602
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
603 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
604 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
605 in_signature="sa{ss}s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
606 out_signature="a{ss}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
607 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
608 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
609 def launchAction(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
610 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
611 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
612 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
613 "launchAction",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
614 unicode(callback_id),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
615 data,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
616 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
617 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
618 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
619 )
60
9764e027ecc0 SàT: multi-profile parameters, first draft
Goffi <goffi@goffi.org>
parents: 57
diff changeset
620
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
621 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
622 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
623 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
624 out_signature="b",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
625 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
626 )
1015
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
627 def loadParamsTemplate(self, filename):
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
628 return self._callback("loadParamsTemplate", unicode(filename))
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
629
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
630 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
631 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
632 in_signature="ss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
633 out_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
634 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
635 )
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
636 def menuHelpGet(self, menu_id, language):
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
637 return self._callback("menuHelpGet", unicode(menu_id), unicode(language))
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
638
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
639 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
640 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
641 in_signature="sasa{ss}is",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
642 out_signature="a{ss}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
643 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
644 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
645 def menuLaunch(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
646 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
647 menu_type,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
648 path,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
649 data,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
650 security_limit,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
651 profile_key,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
652 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
653 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
654 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
655 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
656 "menuLaunch",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
657 unicode(menu_type),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
658 path,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
659 data,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
660 security_limit,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
661 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
662 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
663 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
664 )
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
665
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
666 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
667 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
668 in_signature="si",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
669 out_signature="a(ssasasa{ss})",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
670 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
671 )
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
672 def menusGet(self, language, security_limit):
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
673 return self._callback("menusGet", unicode(language), security_limit)
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
674
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
675 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
676 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
677 in_signature="sa{ss}a{ss}sa{ss}s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
678 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
679 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
680 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
681 def messageSend(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
682 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
683 to_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
684 message,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
685 subject={},
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
686 mess_type="auto",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
687 extra={},
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
688 profile_key="@NONE@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
689 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
690 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
691 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
692 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
693 "messageSend",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
694 unicode(to_jid),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
695 message,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
696 subject,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
697 unicode(mess_type),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
698 extra,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
699 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
700 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
701 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
702 )
2443
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
703
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
704 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
705 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
706 in_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
707 out_signature="a{ss}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
708 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
709 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
710 def namespacesGet(self,):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
711 return self._callback("namespacesGet")
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
712
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
713 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
714 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
715 in_signature="sis",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
716 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
717 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
718 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
719 def paramsRegisterApp(self, xml, security_limit=-1, app=""):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
720 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
721 "paramsRegisterApp", unicode(xml), security_limit, unicode(app)
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
722 )
777
5642939d254e core, bridge: new method paramsRegisterApp to register frontend's specific parameters
souliane <souliane@mailoo.org>
parents: 773
diff changeset
723
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
724 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
725 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
726 in_signature="sss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
727 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
728 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
729 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
730 def profileCreate(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
731 self, profile, password="", component="", callback=None, errback=None
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
732 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
733 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
734 "profileCreate",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
735 unicode(profile),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
736 unicode(password),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
737 unicode(component),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
738 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
739 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
740 )
2144
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
741
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
742 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
743 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
744 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
745 out_signature="b",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
746 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
747 )
1592
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
748 def profileIsSessionStarted(self, profile_key="@DEFAULT@"):
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
749 return self._callback("profileIsSessionStarted", unicode(profile_key))
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
750
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
751 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
752 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
753 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
754 out_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
755 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
756 )
2168
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2150
diff changeset
757 def profileNameGet(self, profile_key="@DEFAULT@"):
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2150
diff changeset
758 return self._callback("profileNameGet", unicode(profile_key))
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2150
diff changeset
759
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
760 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
761 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
762 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
763 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
764 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
765 )
2083
7999d5299ddc bridge(D-Bus): minotr argument name fix
Goffi <goffi@goffi.org>
parents: 2050
diff changeset
766 def profileSetDefault(self, profile):
7999d5299ddc bridge(D-Bus): minotr argument name fix
Goffi <goffi@goffi.org>
parents: 2050
diff changeset
767 return self._callback("profileSetDefault", unicode(profile))
1595
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
768
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
769 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
770 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
771 in_signature="ss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
772 out_signature="b",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
773 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
774 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
775 def profileStartSession(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
776 self, password="", profile_key="@DEFAULT@", callback=None, errback=None
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
777 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
778 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
779 "profileStartSession",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
780 unicode(password),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
781 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
782 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
783 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
784 )
1592
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
785
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
786 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
787 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
788 in_signature="bb",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
789 out_signature="as",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
790 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
791 )
2146
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
792 def profilesListGet(self, clients=True, components=False):
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
793 return self._callback("profilesListGet", clients, components)
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
794
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
795 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
796 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
797 in_signature="ss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
798 out_signature="a{ss}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
799 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
800 )
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
801 def progressGet(self, id, profile):
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
802 return self._callback("progressGet", unicode(id), unicode(profile))
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
803
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
804 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
805 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
806 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
807 out_signature="a{sa{sa{ss}}}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
808 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
809 )
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
810 def progressGetAll(self, profile):
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
811 return self._callback("progressGetAll", unicode(profile))
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
812
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
813 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
814 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
815 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
816 out_signature="a{sa{sa{ss}}}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
817 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
818 )
1626
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
819 def progressGetAllMetadata(self, profile):
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
820 return self._callback("progressGetAllMetadata", unicode(profile))
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
821
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
822 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
823 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
824 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
825 out_signature="b",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
826 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
827 )
1015
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
828 def saveParamsTemplate(self, filename):
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
829 return self._callback("saveParamsTemplate", unicode(filename))
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
830
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
831 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
832 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
833 in_signature="s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
834 out_signature="a{ss}",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
835 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
836 )
2113
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
837 def sessionInfosGet(self, profile_key, callback=None, errback=None):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
838 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
839 "sessionInfosGet", unicode(profile_key), callback=callback, errback=errback
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
840 )
2113
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
841
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
842 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
843 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
844 in_signature="sssis",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
845 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
846 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
847 )
641
49587e170f53 core: added the security_limit to setParam
souliane <souliane@mailoo.org>
parents: 636
diff changeset
848 def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
849 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
850 "setParam",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
851 unicode(name),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
852 unicode(value),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
853 unicode(category),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
854 security_limit,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
855 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
856 )
105
d2630fba8dfd params to XMLUI tools
Goffi <goffi@goffi.org>
parents: 101
diff changeset
857
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
858 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
859 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
860 in_signature="ssa{ss}s",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
861 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
862 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
863 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
864 def setPresence(self, to_jid="", show="", statuses={}, profile_key="@DEFAULT@"):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
865 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
866 "setPresence", unicode(to_jid), unicode(show), statuses, unicode(profile_key)
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
867 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
868
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
869 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
870 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
871 in_signature="sss",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
872 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
873 async_callbacks=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
874 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
875 def subscription(self, sub_type, entity, profile_key="@DEFAULT@"):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
876 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
877 "subscription", unicode(sub_type), unicode(entity), unicode(profile_key)
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
878 )
0
goffi@necton2
parents:
diff changeset
879
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
880 @dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
881 const_INT_PREFIX + const_CORE_SUFFIX,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
882 in_signature="ssass",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
883 out_signature="",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
884 async_callbacks=("callback", "errback"),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
885 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
886 def updateContact(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
887 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
888 entity_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
889 name,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
890 groups,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
891 profile_key="@DEFAULT@",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
892 callback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
893 errback=None,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
894 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
895 return self._callback(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
896 "updateContact",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
897 unicode(entity_jid),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
898 unicode(name),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
899 groups,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
900 unicode(profile_key),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
901 callback=callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
902 errback=errback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
903 )
345
e6047415868d Bridge: added updateContact method
Goffi <goffi@goffi.org>
parents: 337
diff changeset
904
300
233e6fce0b49 DBus bridge: using new generated bridge
Goffi <goffi@goffi.org>
parents: 298
diff changeset
905 def __attributes(self, in_sign):
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
906 """Return arguments to user given a in_sign
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
907 @param in_sign: in_sign in the short form (using s,a,i,b etc)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
908 @return: list of arguments that correspond to a in_sign (e.g.: "sss" return "arg1, arg2, arg3")"""
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
909 i = 0
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
910 idx = 0
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
911 attr = []
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
912 while i < len(in_sign):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
913 if in_sign[i] not in ["b", "y", "n", "i", "x", "q", "u", "t", "d", "s", "a"]:
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
914 raise ParseError("Unmanaged attribute type [%c]" % in_sign[i])
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
915
300
233e6fce0b49 DBus bridge: using new generated bridge
Goffi <goffi@goffi.org>
parents: 298
diff changeset
916 attr.append("arg_%i" % idx)
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
917 idx += 1
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
918
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
919 if in_sign[i] == "a":
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
920 i += 1
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
921 if (
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
922 in_sign[i] != "{" and in_sign[i] != "("
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
923 ): # FIXME: must manage tuples out of arrays
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
924 i += 1
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
925 continue # we have a simple type for the array
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
926 opening_car = in_sign[i]
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
927 assert opening_car in ["{", "("]
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
928 closing_car = "}" if opening_car == "{" else ")"
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
929 opening_count = 1
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
930 while True: # we have a dict or a list of tuples
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
931 i += 1
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
932 if i >= len(in_sign):
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
933 raise ParseError("missing }")
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
934 if in_sign[i] == opening_car:
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
935 opening_count += 1
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
936 if in_sign[i] == closing_car:
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
937 opening_count -= 1
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
938 if opening_count == 0:
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
939 break
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
940 i += 1
300
233e6fce0b49 DBus bridge: using new generated bridge
Goffi <goffi@goffi.org>
parents: 298
diff changeset
941 return attr
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
942
468
c97640c90a94 D-Bus Bridge: use inspection to name attribute + fix asynchronous calls for dynamically added method, it now use deferred return value instead of callback/errback attributes
Goffi <goffi@goffi.org>
parents: 459
diff changeset
943 def addMethod(self, name, int_suffix, in_sign, out_sign, method, async=False):
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
944 """Dynamically add a method to Dbus Bridge"""
468
c97640c90a94 D-Bus Bridge: use inspection to name attribute + fix asynchronous calls for dynamically added method, it now use deferred return value instead of callback/errback attributes
Goffi <goffi@goffi.org>
parents: 459
diff changeset
945 inspect_args = inspect.getargspec(method)
c97640c90a94 D-Bus Bridge: use inspection to name attribute + fix asynchronous calls for dynamically added method, it now use deferred return value instead of callback/errback attributes
Goffi <goffi@goffi.org>
parents: 459
diff changeset
946
469
db4c2b82bab6 D-Bus bridge: fixed getRoomsSubjects call + fixed dynamic addition of methods + added getLastGroupBlogs method
Goffi <goffi@goffi.org>
parents: 468
diff changeset
947 _arguments = inspect_args.args
468
c97640c90a94 D-Bus Bridge: use inspection to name attribute + fix asynchronous calls for dynamically added method, it now use deferred return value instead of callback/errback attributes
Goffi <goffi@goffi.org>
parents: 459
diff changeset
948 _defaults = list(inspect_args.defaults or [])
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
949
468
c97640c90a94 D-Bus Bridge: use inspection to name attribute + fix asynchronous calls for dynamically added method, it now use deferred return value instead of callback/errback attributes
Goffi <goffi@goffi.org>
parents: 459
diff changeset
950 if inspect.ismethod(method):
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
951 # if we have a method, we don't want the first argument (usually 'self')
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
952 del (_arguments[0])
300
233e6fce0b49 DBus bridge: using new generated bridge
Goffi <goffi@goffi.org>
parents: 298
diff changeset
953
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
954 # first arguments are for the _callback method
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
955 arguments_callback = ", ".join(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
956 [repr(name)]
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
957 + (
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
958 (_arguments + ["callback=callback", "errback=errback"])
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
959 if async
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
960 else _arguments
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
961 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
962 )
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
963
300
233e6fce0b49 DBus bridge: using new generated bridge
Goffi <goffi@goffi.org>
parents: 298
diff changeset
964 if async:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
965 _arguments.extend(["callback", "errback"])
469
db4c2b82bab6 D-Bus bridge: fixed getRoomsSubjects call + fixed dynamic addition of methods + added getLastGroupBlogs method
Goffi <goffi@goffi.org>
parents: 468
diff changeset
966 _defaults.extend([None, None])
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
967
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
968 # now we create a second list with default values
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
969 for i in range(1, len(_defaults) + 1):
469
db4c2b82bab6 D-Bus bridge: fixed getRoomsSubjects call + fixed dynamic addition of methods + added getLastGroupBlogs method
Goffi <goffi@goffi.org>
parents: 468
diff changeset
970 _arguments[-i] = "%s = %s" % (_arguments[-i], repr(_defaults[-i]))
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
971
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
972 arguments_defaults = ", ".join(_arguments)
468
c97640c90a94 D-Bus Bridge: use inspection to name attribute + fix asynchronous calls for dynamically added method, it now use deferred return value instead of callback/errback attributes
Goffi <goffi@goffi.org>
parents: 459
diff changeset
973
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
974 code = compile(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
975 "def %(name)s (self,%(arguments_defaults)s): return self._callback(%(arguments_callback)s)"
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
976 % {
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
977 "name": name,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
978 "arguments_defaults": arguments_defaults,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
979 "arguments_callback": arguments_callback,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
980 },
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
981 "<DBus bridge>",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
982 "exec",
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
983 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
984 exec(code) # FIXME: to the same thing in a cleaner way, without compile/exec
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
985 method = locals()[name]
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
986 async_callbacks = ("callback", "errback") if async else None
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
987 setattr(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
988 DbusObject,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
989 name,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
990 dbus.service.method(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
991 const_INT_PREFIX + int_suffix,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
992 in_signature=in_sign,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
993 out_signature=out_sign,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
994 async_callbacks=async_callbacks,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
995 )(method),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
996 )
284
c25371424090 dbus bridge: fixed introspection for dynamically added methods and signals
Goffi <goffi@goffi.org>
parents: 274
diff changeset
997 function = getattr(self, name)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
998 func_table = self._dbus_class_table[
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
999 self.__class__.__module__ + "." + self.__class__.__name__
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1000 ][function._dbus_interface]
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
1001 func_table[function.__name__] = function # Needed for introspection
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
1002
298
15c8916317d0 dbus bridge: added doc parameter, unmanaged yet
Goffi <goffi@goffi.org>
parents: 284
diff changeset
1003 def addSignal(self, name, int_suffix, signature, doc={}):
73
9d113b5471e6 Dynamic signal addition in bridge
Goffi <goffi@goffi.org>
parents: 72
diff changeset
1004 """Dynamically add a signal to Dbus Bridge"""
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1005 attributes = ", ".join(self.__attributes(signature))
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1006 # TODO: use doc parameter to name attributes
73
9d113b5471e6 Dynamic signal addition in bridge
Goffi <goffi@goffi.org>
parents: 72
diff changeset
1007
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1008 # code = compile ('def '+name+' (self,'+attributes+'): log.debug ("'+name+' signal")', '<DBus bridge>','exec') #XXX: the log.debug is too annoying with xmllog
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1009 code = compile(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1010 "def " + name + " (self," + attributes + "): pass", "<DBus bridge>", "exec"
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1011 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1012 exec(code)
73
9d113b5471e6 Dynamic signal addition in bridge
Goffi <goffi@goffi.org>
parents: 72
diff changeset
1013 signal = locals()[name]
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1014 setattr(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1015 DbusObject,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1016 name,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1017 dbus.service.signal(const_INT_PREFIX + int_suffix, signature=signature)(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1018 signal
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1019 ),
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1020 )
284
c25371424090 dbus bridge: fixed introspection for dynamically added methods and signals
Goffi <goffi@goffi.org>
parents: 274
diff changeset
1021 function = getattr(self, name)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1022 func_table = self._dbus_class_table[
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1023 self.__class__.__module__ + "." + self.__class__.__name__
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1024 ][function._dbus_interface]
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
1025 func_table[function.__name__] = function # Needed for introspection
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
1026
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
1027
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
1028 class Bridge(object):
0
goffi@necton2
parents:
diff changeset
1029 def __init__(self):
goffi@necton2
parents:
diff changeset
1030 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
1031 log.info("Init DBus...")
627
d207c2186519 core, bridge, jp, quick_frontend: SàT stop more gracefully if bridge can't be initialised:
Goffi <goffi@goffi.org>
parents: 609
diff changeset
1032 try:
d207c2186519 core, bridge, jp, quick_frontend: SàT stop more gracefully if bridge can't be initialised:
Goffi <goffi@goffi.org>
parents: 609
diff changeset
1033 self.session_bus = dbus.SessionBus()
d207c2186519 core, bridge, jp, quick_frontend: SàT stop more gracefully if bridge can't be initialised:
Goffi <goffi@goffi.org>
parents: 609
diff changeset
1034 except dbus.DBusException as e:
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1035 if e._dbus_error_name == "org.freedesktop.DBus.Error.NotSupported":
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1036 log.error(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1037 _(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1038 u"D-Bus is not launched, please see README to see instructions on how to launch it"
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1039 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1040 )
627
d207c2186519 core, bridge, jp, quick_frontend: SàT stop more gracefully if bridge can't be initialised:
Goffi <goffi@goffi.org>
parents: 609
diff changeset
1041 raise BridgeInitError
10
14d7861ca59e refactoring: CONST replaced by const
Goffi <goffi@goffi.org>
parents: 7
diff changeset
1042 self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus)
360
6b5626c37909 bridge: regenerated DBus bridge
Goffi <goffi@goffi.org>
parents: 345
diff changeset
1043 self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH)
0
goffi@necton2
parents:
diff changeset
1044
1599
e2ed8009e66e backend, bridge, frontends: actionNew has now a security_limit argument + added some docstring to explain data argument
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
1045 def actionNew(self, action_data, id, security_limit, profile):
e2ed8009e66e backend, bridge, frontends: actionNew has now a security_limit argument + added some docstring to explain data argument
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
1046 self.dbus_bridge.actionNew(action_data, id, security_limit, profile)
1467
ceba6fd77739 core, bridge: new signal actionNew to launch an action from the backend (e.g. display a dialog message):
Goffi <goffi@goffi.org>
parents: 1435
diff changeset
1047
1435
7590bbf44eed bridge, quick_frontend: the JID that is assigned by the server can differ from the one we asked for (resource)
souliane <souliane@mailoo.org>
parents: 1414
diff changeset
1048 def connected(self, profile, jid_s):
7590bbf44eed bridge, quick_frontend: the JID that is assigned by the server can differ from the one we asked for (resource)
souliane <souliane@mailoo.org>
parents: 1414
diff changeset
1049 self.dbus_bridge.connected(profile, jid_s)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
1050
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
1051 def contactDeleted(self, entity_jid, profile):
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
1052 self.dbus_bridge.contactDeleted(entity_jid, profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
1053
66
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
1054 def disconnected(self, profile):
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
1055 self.dbus_bridge.disconnected(profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
1056
504
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
1057 def entityDataUpdated(self, jid, name, value, profile):
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
1058 self.dbus_bridge.entityDataUpdated(jid, name, value, profile)
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
1059
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1060 def messageNew(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1061 self,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1062 uid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1063 timestamp,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1064 from_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1065 to_jid,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1066 message,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1067 subject,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1068 mess_type,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1069 extra,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1070 profile,
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1071 ):
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1072 self.dbus_bridge.messageNew(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1073 uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1074 )
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
1075
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
1076 def newContact(self, contact_jid, attributes, groups, profile):
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
1077 self.dbus_bridge.newContact(contact_jid, attributes, groups, profile)
0
goffi@necton2
parents:
diff changeset
1078
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
1079 def paramUpdate(self, name, value, category, profile):
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
1080 self.dbus_bridge.paramUpdate(name, value, category, profile)
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
1081
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
1082 def presenceUpdate(self, entity_jid, show, priority, statuses, profile):
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
1083 self.dbus_bridge.presenceUpdate(entity_jid, show, priority, statuses, profile)
49
9c79eb49d51f DBus bridge improvment:
Goffi <goffi@goffi.org>
parents: 37
diff changeset
1084
1917
05a5a125a238 bridge (frontend): raise a BridgeExceptionNoService on org.freedesktop.DBus.Error.Spawn.ExecFailed D-Bus error
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
1085 def progressError(self, id, error, profile):
05a5a125a238 bridge (frontend): raise a BridgeExceptionNoService on org.freedesktop.DBus.Error.Spawn.ExecFailed D-Bus error
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
1086 self.dbus_bridge.progressError(id, error, profile)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
1087
1626
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
1088 def progressFinished(self, id, metadata, profile):
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
1089 self.dbus_bridge.progressFinished(id, metadata, profile)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
1090
1626
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
1091 def progressStarted(self, id, metadata, profile):
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
1092 self.dbus_bridge.progressStarted(id, metadata, profile)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
1093
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
1094 def subscribe(self, sub_type, entity_jid, profile):
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
1095 self.dbus_bridge.subscribe(sub_type, entity_jid, profile)
0
goffi@necton2
parents:
diff changeset
1096
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
1097 def register_method(self, name, callback):
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
1098 log.debug("registering DBus bridge method [%s]" % name)
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
1099 self.dbus_bridge.register_method(name, callback)
0
goffi@necton2
parents:
diff changeset
1100
300
233e6fce0b49 DBus bridge: using new generated bridge
Goffi <goffi@goffi.org>
parents: 298
diff changeset
1101 def addMethod(self, name, int_suffix, in_sign, out_sign, method, async=False, doc={}):
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
1102 """Dynamically add a method to Dbus Bridge"""
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1103 # FIXME: doc parameter is kept only temporary, the time to remove it from calls
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
1104 log.debug("Adding method [%s] to DBus bridge" % name)
468
c97640c90a94 D-Bus Bridge: use inspection to name attribute + fix asynchronous calls for dynamically added method, it now use deferred return value instead of callback/errback attributes
Goffi <goffi@goffi.org>
parents: 459
diff changeset
1105 self.dbus_bridge.addMethod(name, int_suffix, in_sign, out_sign, method, async)
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
1106 self.register_method(name, method)
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
1107
298
15c8916317d0 dbus bridge: added doc parameter, unmanaged yet
Goffi <goffi@goffi.org>
parents: 284
diff changeset
1108 def addSignal(self, name, int_suffix, signature, doc={}):
300
233e6fce0b49 DBus bridge: using new generated bridge
Goffi <goffi@goffi.org>
parents: 298
diff changeset
1109 self.dbus_bridge.addSignal(name, int_suffix, signature, doc)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
1110 setattr(Bridge, name, getattr(self.dbus_bridge, name))