annotate sat_frontends/bridge/dbus_bridge.py @ 3588:2c7a52a62be3

plugin XEP-0060: events callbacks can now be sync or async
author Goffi <goffi@goffi.org>
date Thu, 29 Jul 2021 17:10:36 +0200
parents 7550ae9cfbac
children 71cfe9334f73
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
1 #!/usr/bin/env python3
0
goffi@necton2
parents:
diff changeset
2
3143
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
3 # SàT communication bridge
3479
be6d91572633 date update
Goffi <goffi@goffi.org>
parents: 3259
diff changeset
4 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org)
0
goffi@necton2
parents:
diff changeset
5
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
6 # 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
7 # 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
8 # 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
9 # (at your option) any later version.
0
goffi@necton2
parents:
diff changeset
10
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
11 # 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
12 # 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
13 # 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
14 # GNU Affero General Public License for more details.
0
goffi@necton2
parents:
diff changeset
15
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
16 # 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
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
0
goffi@necton2
parents:
diff changeset
18
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
19 import asyncio
535
790be337cc41 bridge: fixed D-Bus warning in frontend side of bridge
Goffi <goffi@goffi.org>
parents: 504
diff changeset
20 import dbus
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
21 import ast
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
22 from sat.core.i18n import _
3143
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
23 from sat.tools import config
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
24 from sat.core.log import getLogger
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
25 from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
26 from dbus.mainloop.glib import DBusGMainLoop
3143
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
27 from .bridge_frontend import BridgeException
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
28
0
goffi@necton2
parents:
diff changeset
29
535
790be337cc41 bridge: fixed D-Bus warning in frontend side of bridge
Goffi <goffi@goffi.org>
parents: 504
diff changeset
30 DBusGMainLoop(set_as_default=True)
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
31 log = getLogger(__name__)
535
790be337cc41 bridge: fixed D-Bus warning in frontend side of bridge
Goffi <goffi@goffi.org>
parents: 504
diff changeset
32
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
33
3143
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
34 # Interface prefix
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
35 const_INT_PREFIX = config.getConfig(
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
36 config.parseMainConf(),
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
37 "",
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
38 "bridge_dbus_int_prefix",
3480
7550ae9cfbac Renamed the project from "Salut à Toi" to "Libervia":
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
39 "org.libervia.Libervia")
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
40 const_ERROR_PREFIX = const_INT_PREFIX + ".error"
3480
7550ae9cfbac Renamed the project from "Salut à Toi" to "Libervia":
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
41 const_OBJ_PATH = '/org/libervia/Libervia/bridge'
372
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
42 const_CORE_SUFFIX = ".core"
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
43 const_PLUGIN_SUFFIX = ".plugin"
1072
d123d61976c8 bridge (D-Bus): frontend side now use a 120 s timeout for async calls
Goffi <goffi@goffi.org>
parents: 1062
diff changeset
44 const_TIMEOUT = 120
360
6b5626c37909 bridge: regenerated DBus bridge
Goffi <goffi@goffi.org>
parents: 345
diff changeset
45
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
46
1062
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
47 def dbus_to_bridge_exception(dbus_e):
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
48 """Convert a DBusException to a BridgeException.
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
49
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
50 @param dbus_e (DBusException)
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
51 @return: BridgeException
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
52 """
1188
bf2927e6a0f5 frontends (dbus): error is not truncated anymore if it's not a SàT error.
Goffi <goffi@goffi.org>
parents: 1073
diff changeset
53 full_name = dbus_e.get_dbus_name()
bf2927e6a0f5 frontends (dbus): error is not truncated anymore if it's not a SàT error.
Goffi <goffi@goffi.org>
parents: 1073
diff changeset
54 if full_name.startswith(const_ERROR_PREFIX):
bf2927e6a0f5 frontends (dbus): error is not truncated anymore if it's not a SàT error.
Goffi <goffi@goffi.org>
parents: 1073
diff changeset
55 name = dbus_e.get_dbus_name()[len(const_ERROR_PREFIX) + 1:]
bf2927e6a0f5 frontends (dbus): error is not truncated anymore if it's not a SàT error.
Goffi <goffi@goffi.org>
parents: 1073
diff changeset
56 else:
bf2927e6a0f5 frontends (dbus): error is not truncated anymore if it's not a SàT error.
Goffi <goffi@goffi.org>
parents: 1073
diff changeset
57 name = full_name
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
58 # XXX: dbus_e.args doesn't contain the original DBusException args, but we
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
59 # receive its serialized form in dbus_e.args[0]. From that we can rebuild
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
60 # the original arguments list thanks to ast.literal_eval (secure eval).
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
61 message = dbus_e.get_dbus_message() # similar to dbus_e.args[0]
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
62 try:
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
63 message, condition = ast.literal_eval(message)
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
64 except (SyntaxError, ValueError, TypeError):
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
65 condition = ''
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
66 return BridgeException(name, message, condition)
1062
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
67
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
68
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
69 class Bridge:
2091
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
70
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
71 def bridgeConnect(self, callback, errback):
165
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
72 try:
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
73 self.sessions_bus = dbus.SessionBus()
360
6b5626c37909 bridge: regenerated DBus bridge
Goffi <goffi@goffi.org>
parents: 345
diff changeset
74 self.db_object = self.sessions_bus.get_object(const_INT_PREFIX,
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
75 const_OBJ_PATH)
372
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
76 self.db_core_iface = dbus.Interface(self.db_object,
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
77 dbus_interface=const_INT_PREFIX + const_CORE_SUFFIX)
372
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
78 self.db_plugin_iface = dbus.Interface(self.db_object,
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
79 dbus_interface=const_INT_PREFIX + const_PLUGIN_SUFFIX)
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
80 except dbus.exceptions.DBusException as e:
1917
05a5a125a238 bridge (frontend): raise a BridgeExceptionNoService on org.freedesktop.DBus.Error.Spawn.ExecFailed D-Bus error
Goffi <goffi@goffi.org>
parents: 1794
diff changeset
81 if e._dbus_error_name in ('org.freedesktop.DBus.Error.ServiceUnknown',
05a5a125a238 bridge (frontend): raise a BridgeExceptionNoService on org.freedesktop.DBus.Error.Spawn.ExecFailed D-Bus error
Goffi <goffi@goffi.org>
parents: 1794
diff changeset
82 'org.freedesktop.DBus.Error.Spawn.ExecFailed'):
2091
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
83 errback(BridgeExceptionNoService())
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
84 elif e._dbus_error_name == 'org.freedesktop.DBus.Error.NotSupported':
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
85 log.error(_("D-Bus is not launched, please see README to see instructions on how to launch it"))
2091
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
86 errback(BridgeInitError)
165
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
87 else:
2091
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
88 errback(e)
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
89 else:
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
90 callback()
372
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
91 #props = self.db_core_iface.getProperties()
0
goffi@necton2
parents:
diff changeset
92
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2083
diff changeset
93 def register_signal(self, functionName, handler, iface="core"):
372
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
94 if iface == "core":
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
95 self.db_core_iface.connect_to_signal(functionName, handler)
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
96 elif iface == "plugin":
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
97 self.db_plugin_iface.connect_to_signal(functionName, handler)
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
98 else:
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
99 log.error(_('Unknown interface'))
0
goffi@necton2
parents:
diff changeset
100
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
101 def __getattribute__(self, name):
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
102 """ usual __getattribute__ if the method exists, else try to find a plugin method """
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
103 try:
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
104 return object.__getattribute__(self, name)
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
105 except AttributeError:
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
106 # The attribute is not found, we try the plugin proxy to find the requested method
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
107
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
108 def getPluginMethod(*args, **kwargs):
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
109 # We first check if we have an async call. We detect this in two ways:
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
110 # - if we have the 'callback' and 'errback' keyword arguments
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
111 # - or if the last two arguments are callable
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
112
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
113 async_ = False
1794
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
114 args = list(args)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
115
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
116 if kwargs:
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
117 if 'callback' in kwargs:
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
118 async_ = True
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
119 _callback = kwargs.pop('callback')
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
120 _errback = kwargs.pop('errback', lambda failure: log.error(str(failure)))
1794
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
121 try:
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
122 args.append(kwargs.pop('profile'))
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
123 except KeyError:
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
124 try:
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
125 args.append(kwargs.pop('profile_key'))
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
126 except KeyError:
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
127 pass
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
128 # at this point, kwargs should be empty
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
129 if kwargs:
3242
6d0137022df2 bridge (dbus): fixed typo in log.warning
Goffi <goffi@goffi.org>
parents: 3206
diff changeset
130 log.warning("unexpected keyword arguments, they will be ignored: {}".format(kwargs))
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
131 elif len(args) >= 2 and callable(args[-1]) and callable(args[-2]):
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
132 async_ = True
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
133 _errback = args.pop()
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
134 _callback = args.pop()
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
135
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
136 method = getattr(self.db_plugin_iface, name)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
137
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
138 if async_:
1072
d123d61976c8 bridge (D-Bus): frontend side now use a 120 s timeout for async calls
Goffi <goffi@goffi.org>
parents: 1062
diff changeset
139 kwargs['timeout'] = const_TIMEOUT
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
140 kwargs['reply_handler'] = _callback
1062
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
141 kwargs['error_handler'] = lambda err: _errback(dbus_to_bridge_exception(err))
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
142
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
143 return method(*args, **kwargs)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
144
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
145 return getPluginMethod
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
146
1622
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
147 def actionsGet(self, profile_key="@DEFAULT@", callback=None, errback=None):
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
148 if callback is None:
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
149 error_handler = None
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
150 else:
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
151 if errback is None:
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
152 errback = log.error
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
153 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
154 kwargs={}
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
155 if callback is not None:
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
156 kwargs['timeout'] = const_TIMEOUT
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
157 kwargs['reply_handler'] = callback
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
158 kwargs['error_handler'] = error_handler
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
159 return self.db_core_iface.actionsGet(profile_key, **kwargs)
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
160
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
161 def addContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
162 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
163 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
164 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
165 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
166 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
167 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
168 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
169 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
170 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
171 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
172 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
173 return self.db_core_iface.addContact(entity_jid, profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
174
893
308a96bc7c1b core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile
souliane <souliane@mailoo.org>
parents: 811
diff changeset
175 def asyncDeleteProfile(self, profile, callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
176 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
177 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
178 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
179 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
180 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
181 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1237
c1e916594e09 bridge (frontends side): fixed call of async method in blocking context
Goffi <goffi@goffi.org>
parents: 1224
diff changeset
182 return self.db_core_iface.asyncDeleteProfile(profile, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
893
308a96bc7c1b core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile
souliane <souliane@mailoo.org>
parents: 811
diff changeset
183
656
7d6e5807504a bridge, memory: added the parameter security_limit to asyncGetParamA so it can be used from libervia. refactorization in memory.py are related to that.
souliane <souliane@mailoo.org>
parents: 641
diff changeset
184 def asyncGetParamA(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
185 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
186 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
187 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
188 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
189 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
190 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
191 return str(self.db_core_iface.asyncGetParamA(name, category, attribute, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 405
diff changeset
192
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3102
diff changeset
193 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@", callback=None, errback=None):
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
194 if callback is None:
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
195 error_handler = None
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
196 else:
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
197 if errback is None:
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
198 errback = log.error
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
199 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3102
diff changeset
200 return self.db_core_iface.asyncGetParamsValuesFromCategory(category, security_limit, app, extra, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
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
201
2142
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
202 def connect(self, profile_key="@DEFAULT@", password='', options={}, callback=None, errback=None):
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
203 if callback is None:
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
204 error_handler = None
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
205 else:
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
206 if errback is None:
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
207 errback = log.error
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
208 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
209 return self.db_core_iface.connect(profile_key, password, options, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
210
3254
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
211 def contactGet(self, arg_0, profile_key="@DEFAULT@", callback=None, errback=None):
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
212 if callback is None:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
213 error_handler = None
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
214 else:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
215 if errback is None:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
216 errback = log.error
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
217 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
218 return self.db_core_iface.contactGet(arg_0, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
219
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
220 def delContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
221 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
222 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
223 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
224 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
225 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
226 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
227 return self.db_core_iface.delContact(entity_jid, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
228
3206
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
229 def devicesInfosGet(self, bare_jid, profile_key, callback=None, errback=None):
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
230 if callback is None:
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
231 error_handler = None
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
232 else:
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
233 if errback is None:
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
234 errback = log.error
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
235 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
236 return str(self.db_core_iface.devicesInfosGet(bare_jid, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
237
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
238 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@", callback=None, errback=None):
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
239 if callback is None:
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
240 error_handler = None
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
241 else:
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
242 if errback is None:
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
243 errback = log.error
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
244 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2595
973d4551ffae core: added local_device argument to discoFindByFeatures
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
245 return self.db_core_iface.discoFindByFeatures(namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
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
246
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
247 def discoInfos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
248 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
249 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
250 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
251 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
252 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
253 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2342
f047d5410040 core (memory/disco): added use_cache parameter to discoInfos/discoItems (set to False to ignore cache)
Goffi <goffi@goffi.org>
parents: 2168
diff changeset
254 return self.db_core_iface.discoInfos(entity_jid, node, use_cache, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
963
723f28cd15c7 core (disco): added discoInfos and discoItems bridge methods
Goffi <goffi@goffi.org>
parents: 943
diff changeset
255
3039
a1bc34f90fa5 bridge (pb): implemented an asyncio compatible bridge:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
256 def discoItems(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
257 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
258 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
259 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
260 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
261 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
262 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2342
f047d5410040 core (memory/disco): added use_cache parameter to discoInfos/discoItems (set to False to ignore cache)
Goffi <goffi@goffi.org>
parents: 2168
diff changeset
263 return self.db_core_iface.discoItems(entity_jid, node, use_cache, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
963
723f28cd15c7 core (disco): added discoInfos and discoItems bridge methods
Goffi <goffi@goffi.org>
parents: 943
diff changeset
264
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
265 def disconnect(self, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
266 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
267 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
268 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
269 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
270 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
271 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2144
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
272 return self.db_core_iface.disconnect(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
273
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
274 def encryptionNamespaceGet(self, arg_0, callback=None, errback=None):
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
275 if callback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
276 error_handler = None
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
277 else:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
278 if errback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
279 errback = log.error
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
280 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
281 kwargs={}
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
282 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
283 kwargs['timeout'] = const_TIMEOUT
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
284 kwargs['reply_handler'] = callback
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
285 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
286 return str(self.db_core_iface.encryptionNamespaceGet(arg_0, **kwargs))
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
287
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
288 def encryptionPluginsGet(self, callback=None, errback=None):
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
289 if callback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
290 error_handler = None
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
291 else:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
292 if errback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
293 errback = log.error
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
294 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
295 kwargs={}
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
296 if callback is not None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
297 kwargs['timeout'] = const_TIMEOUT
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
298 kwargs['reply_handler'] = callback
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
299 kwargs['error_handler'] = error_handler
3102
7574f795bd1e core, bridge: encryptionPluginsGet now returns a serialised list + added "directed" in metadata
Goffi <goffi@goffi.org>
parents: 3066
diff changeset
300 return str(self.db_core_iface.encryptionPluginsGet(**kwargs))
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
301
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
302 def encryptionTrustUIGet(self, to_jid, namespace, profile_key, callback=None, errback=None):
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
303 if callback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
304 error_handler = None
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
305 else:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
306 if errback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
307 errback = log.error
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
308 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
309 return str(self.db_core_iface.encryptionTrustUIGet(to_jid, namespace, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
310
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
311 def getConfig(self, section, name, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
312 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
313 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
314 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
315 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
316 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
317 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
318 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
319 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
320 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
321 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
322 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
323 return str(self.db_core_iface.getConfig(section, name, **kwargs))
364
312ca6f9d84a core: configuration file
Goffi <goffi@goffi.org>
parents: 362
diff changeset
324
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
325 def getContacts(self, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
326 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
327 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
328 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
329 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
330 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
331 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
332 return self.db_core_iface.getContacts(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
333
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
334 def getContactsFromGroup(self, group, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
335 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
336 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
337 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
338 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
339 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
340 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
341 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
342 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
343 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
344 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
345 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
346 return self.db_core_iface.getContactsFromGroup(group, profile_key, **kwargs)
501
e9634d2e7b38 core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
Goffi <goffi@goffi.org>
parents: 492
diff changeset
347
1314
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
348 def getEntitiesData(self, jids, keys, profile, callback=None, errback=None):
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
349 if callback is None:
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
350 error_handler = None
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
351 else:
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
352 if errback is None:
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
353 errback = log.error
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
354 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
355 kwargs={}
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
356 if callback is not None:
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
357 kwargs['timeout'] = const_TIMEOUT
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
358 kwargs['reply_handler'] = callback
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
359 kwargs['error_handler'] = error_handler
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
360 return self.db_core_iface.getEntitiesData(jids, keys, profile, **kwargs)
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
361
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
362 def getEntityData(self, jid, keys, profile, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
363 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
364 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
365 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
366 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
367 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
368 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
369 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
370 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
371 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
372 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
373 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
374 return self.db_core_iface.getEntityData(jid, keys, profile, **kwargs)
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
375
1482
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
376 def getFeatures(self, profile_key, callback=None, errback=None):
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
377 if callback is None:
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
378 error_handler = None
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
379 else:
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
380 if errback is None:
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
381 errback = log.error
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
382 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
383 return self.db_core_iface.getFeatures(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
384
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
385 def getMainResource(self, contact_jid, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
386 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
387 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
388 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
389 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
390 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
391 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
392 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
393 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
394 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
395 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
396 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
397 return str(self.db_core_iface.getMainResource(contact_jid, profile_key, **kwargs))
399
3ed53803b3b3 core: added getLastResource method
Goffi <goffi@goffi.org>
parents: 387
diff changeset
398
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
399 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
400 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
401 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
402 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
403 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
404 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
405 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
406 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
407 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
408 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
409 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
410 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
411 return str(self.db_core_iface.getParamA(name, category, attribute, profile_key, **kwargs))
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
412
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
413 def getParamsCategories(self, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
414 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
415 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
416 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
417 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
418 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
419 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
420 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
421 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
422 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
423 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
424 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
425 return self.db_core_iface.getParamsCategories(**kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
426
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3102
diff changeset
427 def getParamsUI(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
428 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
429 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
430 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
431 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
432 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
433 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3102
diff changeset
434 return str(self.db_core_iface.getParamsUI(security_limit, app, extra, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
435
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
436 def getPresenceStatuses(self, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
437 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
438 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
439 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
440 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
441 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
442 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
443 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
444 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
445 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
446 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
447 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
448 return self.db_core_iface.getPresenceStatuses(profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
449
1024
7e43ea75cce8 bridge (constructor): fixed D-Bus frontend generator for async method without sig_in + fixed --debug option + regenerated bridge to fix bad frontend D-Bus bridge.
Goffi <goffi@goffi.org>
parents: 1023
diff changeset
450 def getReady(self, callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
451 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
452 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
453 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
454 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
455 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
456 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1237
c1e916594e09 bridge (frontends side): fixed call of async method in blocking context
Goffi <goffi@goffi.org>
parents: 1224
diff changeset
457 return self.db_core_iface.getReady(timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
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
458
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
459 def getVersion(self, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
460 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
461 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
462 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
463 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
464 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
465 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
466 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
467 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
468 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
469 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
470 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
471 return str(self.db_core_iface.getVersion(**kwargs))
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
472
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
473 def getWaitingSub(self, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
474 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
475 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
476 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
477 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
478 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
479 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
480 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
481 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
482 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
483 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
484 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
485 return self.db_core_iface.getWaitingSub(profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
486
2013
b536dd121da1 backend (memory), frontends: improved history filtering:
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
487 def historyGet(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@", callback=None, errback=None):
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
488 if callback is None:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
489 error_handler = None
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
490 else:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
491 if errback is None:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
492 errback = log.error
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
493 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2013
b536dd121da1 backend (memory), frontends: improved history filtering:
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
494 return self.db_core_iface.historyGet(from_jid, to_jid, limit, between, filters, profile, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
495
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
496 def imageCheck(self, arg_0, callback=None, errback=None):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
497 if callback is None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
498 error_handler = None
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
499 else:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
500 if errback is None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
501 errback = log.error
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
502 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
503 kwargs={}
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
504 if callback is not None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
505 kwargs['timeout'] = const_TIMEOUT
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
506 kwargs['reply_handler'] = callback
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
507 kwargs['error_handler'] = error_handler
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
508 return str(self.db_core_iface.imageCheck(arg_0, **kwargs))
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
509
3259
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
510 def imageConvert(self, source, dest, arg_2, extra, callback=None, errback=None):
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
511 if callback is None:
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
512 error_handler = None
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
513 else:
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
514 if errback is None:
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
515 errback = log.error
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
516 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
517 return str(self.db_core_iface.imageConvert(source, dest, arg_2, extra, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
518
3201
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
519 def imageGeneratePreview(self, image_path, profile_key, callback=None, errback=None):
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
520 if callback is None:
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
521 error_handler = None
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
522 else:
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
523 if errback is None:
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
524 errback = log.error
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
525 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
526 return str(self.db_core_iface.imageGeneratePreview(image_path, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
527
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
528 def imageResize(self, image_path, width, height, callback=None, errback=None):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
529 if callback is None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
530 error_handler = None
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
531 else:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
532 if errback is None:
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
533 errback = log.error
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
534 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
535 return str(self.db_core_iface.imageResize(image_path, width, height, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
536
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
537 def isConnected(self, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
538 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
539 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
540 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
541 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
542 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
543 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
544 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
545 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
546 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
547 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
548 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
549 return self.db_core_iface.isConnected(profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
550
759
93bd868b8fb6 backend, frontends: callbacks refactoring:
Goffi <goffi@goffi.org>
parents: 755
diff changeset
551 def launchAction(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
552 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
553 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
554 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
555 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
556 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
557 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1237
c1e916594e09 bridge (frontends side): fixed call of async method in blocking context
Goffi <goffi@goffi.org>
parents: 1224
diff changeset
558 return self.db_core_iface.launchAction(callback_id, data, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
559
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
560 def loadParamsTemplate(self, filename, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
561 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
562 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
563 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
564 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
565 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
566 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
567 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
568 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
569 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
570 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
571 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
572 return self.db_core_iface.loadParamsTemplate(filename, **kwargs)
1015
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
573
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
574 def menuHelpGet(self, menu_id, language, callback=None, errback=None):
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
575 if callback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
576 error_handler = None
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
577 else:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
578 if errback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
579 errback = log.error
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
580 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
581 kwargs={}
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
582 if callback is not None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
583 kwargs['timeout'] = const_TIMEOUT
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
584 kwargs['reply_handler'] = callback
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
585 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
586 return str(self.db_core_iface.menuHelpGet(menu_id, language, **kwargs))
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
587
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
588 def menuLaunch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None):
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
589 if callback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
590 error_handler = None
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
591 else:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
592 if errback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
593 errback = log.error
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
594 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
595 return self.db_core_iface.menuLaunch(menu_type, path, data, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
596
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
597 def menusGet(self, language, security_limit, callback=None, errback=None):
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
598 if callback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
599 error_handler = None
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
600 else:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
601 if errback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
602 errback = log.error
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
603 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
604 kwargs={}
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
605 if callback is not None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
606 kwargs['timeout'] = const_TIMEOUT
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
607 kwargs['reply_handler'] = callback
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
608 kwargs['error_handler'] = error_handler
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
609 return self.db_core_iface.menusGet(language, security_limit, **kwargs)
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
610
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
611 def messageEncryptionGet(self, to_jid, profile_key, callback=None, errback=None):
2646
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
612 if callback is None:
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
613 error_handler = None
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
614 else:
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
615 if errback is None:
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
616 errback = log.error
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
617 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
618 kwargs={}
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
619 if callback is not None:
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
620 kwargs['timeout'] = const_TIMEOUT
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
621 kwargs['reply_handler'] = callback
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
622 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
623 return str(self.db_core_iface.messageEncryptionGet(to_jid, profile_key, **kwargs))
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
624
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
625 def messageEncryptionStart(self, to_jid, namespace='', replace=False, profile_key="@NONE@", callback=None, errback=None):
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
626 if callback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
627 error_handler = None
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
628 else:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
629 if errback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
630 errback = log.error
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
631 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2743
da59ff099b32 core (memory/encryption), plugin OTR: finished OTR integration in encryption:
Goffi <goffi@goffi.org>
parents: 2733
diff changeset
632 return self.db_core_iface.messageEncryptionStart(to_jid, namespace, replace, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
633
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
634 def messageEncryptionStop(self, to_jid, profile_key, callback=None, errback=None):
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
635 if callback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
636 error_handler = None
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
637 else:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
638 if errback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
639 errback = log.error
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
640 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2743
da59ff099b32 core (memory/encryption), plugin OTR: finished OTR integration in encryption:
Goffi <goffi@goffi.org>
parents: 2733
diff changeset
641 return self.db_core_iface.messageEncryptionStop(to_jid, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
2646
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
642
1963
a2bc5089c2eb backend, frontends: message refactoring (huge commit):
Goffi <goffi@goffi.org>
parents: 1955
diff changeset
643 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
644 if callback is None:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
645 error_handler = None
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
646 else:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
647 if errback is None:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
648 errback = log.error
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
649 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
650 return self.db_core_iface.messageSend(to_jid, message, subject, mess_type, extra, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
651
2443
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
652 def namespacesGet(self, callback=None, errback=None):
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
653 if callback is None:
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
654 error_handler = None
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
655 else:
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
656 if errback is None:
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
657 errback = log.error
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
658 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
659 kwargs={}
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
660 if callback is not None:
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
661 kwargs['timeout'] = const_TIMEOUT
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
662 kwargs['reply_handler'] = callback
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
663 kwargs['error_handler'] = error_handler
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
664 return self.db_core_iface.namespacesGet(**kwargs)
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
665
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
666 def paramsRegisterApp(self, xml, security_limit=-1, app='', callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
667 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
668 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
669 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
670 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
671 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
672 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
673 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
674 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
675 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
676 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
677 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
678 return self.db_core_iface.paramsRegisterApp(xml, security_limit, app, **kwargs)
777
5642939d254e core, bridge: new method paramsRegisterApp to register frontend's specific parameters
souliane <souliane@mailoo.org>
parents: 773
diff changeset
679
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
680 def privateDataDelete(self, namespace, key, arg_2, callback=None, errback=None):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
681 if callback is None:
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
682 error_handler = None
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
683 else:
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
684 if errback is None:
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
685 errback = log.error
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
686 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
687 return self.db_core_iface.privateDataDelete(namespace, key, arg_2, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
688
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
689 def privateDataGet(self, namespace, key, profile_key, callback=None, errback=None):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
690 if callback is None:
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
691 error_handler = None
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
692 else:
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
693 if errback is None:
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
694 errback = log.error
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
695 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
696 return str(self.db_core_iface.privateDataGet(namespace, key, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
697
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
698 def privateDataSet(self, namespace, key, data, profile_key, callback=None, errback=None):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
699 if callback is None:
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
700 error_handler = None
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
701 else:
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
702 if errback is None:
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
703 errback = log.error
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
704 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
705 return self.db_core_iface.privateDataSet(namespace, key, data, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
706
2144
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
707 def profileCreate(self, profile, password='', component='', callback=None, errback=None):
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
708 if callback is None:
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
709 error_handler = None
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
710 else:
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
711 if errback is None:
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
712 errback = log.error
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
713 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
714 return self.db_core_iface.profileCreate(profile, password, component, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
715
1592
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
716 def profileIsSessionStarted(self, profile_key="@DEFAULT@", callback=None, errback=None):
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
717 if callback is None:
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
718 error_handler = None
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
719 else:
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
720 if errback is None:
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
721 errback = log.error
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
722 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
723 kwargs={}
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
724 if callback is not None:
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
725 kwargs['timeout'] = const_TIMEOUT
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
726 kwargs['reply_handler'] = callback
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
727 kwargs['error_handler'] = error_handler
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
728 return self.db_core_iface.profileIsSessionStarted(profile_key, **kwargs)
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
729
2168
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
730 def profileNameGet(self, profile_key="@DEFAULT@", callback=None, errback=None):
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
731 if callback is None:
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
732 error_handler = None
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
733 else:
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
734 if errback is None:
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
735 errback = log.error
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
736 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
737 kwargs={}
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
738 if callback is not None:
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
739 kwargs['timeout'] = const_TIMEOUT
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
740 kwargs['reply_handler'] = callback
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
741 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
742 return str(self.db_core_iface.profileNameGet(profile_key, **kwargs))
2168
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
743
2083
7999d5299ddc bridge(D-Bus): minotr argument name fix
Goffi <goffi@goffi.org>
parents: 2050
diff changeset
744 def profileSetDefault(self, profile, callback=None, errback=None):
1595
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
745 if callback is None:
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
746 error_handler = None
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
747 else:
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
748 if errback is None:
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
749 errback = log.error
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
750 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
751 kwargs={}
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
752 if callback is not None:
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
753 kwargs['timeout'] = const_TIMEOUT
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
754 kwargs['reply_handler'] = callback
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
755 kwargs['error_handler'] = error_handler
2083
7999d5299ddc bridge(D-Bus): minotr argument name fix
Goffi <goffi@goffi.org>
parents: 2050
diff changeset
756 return self.db_core_iface.profileSetDefault(profile, **kwargs)
1595
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
757
1592
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
758 def profileStartSession(self, password='', profile_key="@DEFAULT@", callback=None, errback=None):
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
759 if callback is None:
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
760 error_handler = None
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
761 else:
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
762 if errback is None:
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
763 errback = log.error
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
764 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
765 return self.db_core_iface.profileStartSession(password, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
766
2146
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
767 def profilesListGet(self, clients=True, components=False, callback=None, errback=None):
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
768 if callback is None:
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
769 error_handler = None
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
770 else:
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
771 if errback is None:
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
772 errback = log.error
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
773 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
774 kwargs={}
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
775 if callback is not None:
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
776 kwargs['timeout'] = const_TIMEOUT
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
777 kwargs['reply_handler'] = callback
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
778 kwargs['error_handler'] = error_handler
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
779 return self.db_core_iface.profilesListGet(clients, components, **kwargs)
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
780
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
781 def progressGet(self, id, profile, callback=None, errback=None):
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
782 if callback is None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
783 error_handler = None
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
784 else:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
785 if errback is None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
786 errback = log.error
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
787 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
788 kwargs={}
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
789 if callback is not None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
790 kwargs['timeout'] = const_TIMEOUT
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
791 kwargs['reply_handler'] = callback
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
792 kwargs['error_handler'] = error_handler
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
793 return self.db_core_iface.progressGet(id, profile, **kwargs)
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
794
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
795 def progressGetAll(self, profile, callback=None, errback=None):
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
796 if callback is None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
797 error_handler = None
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
798 else:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
799 if errback is None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
800 errback = log.error
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
801 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
802 kwargs={}
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
803 if callback is not None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
804 kwargs['timeout'] = const_TIMEOUT
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
805 kwargs['reply_handler'] = callback
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
806 kwargs['error_handler'] = error_handler
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
807 return self.db_core_iface.progressGetAll(profile, **kwargs)
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
808
1626
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
809 def progressGetAllMetadata(self, profile, callback=None, errback=None):
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
810 if callback is None:
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
811 error_handler = None
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
812 else:
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
813 if errback is None:
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
814 errback = log.error
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
815 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
816 kwargs={}
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
817 if callback is not None:
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
818 kwargs['timeout'] = const_TIMEOUT
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
819 kwargs['reply_handler'] = callback
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
820 kwargs['error_handler'] = error_handler
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
821 return self.db_core_iface.progressGetAllMetadata(profile, **kwargs)
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
822
2892
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
823 def rosterResync(self, profile_key="@DEFAULT@", callback=None, errback=None):
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
824 if callback is None:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
825 error_handler = None
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
826 else:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
827 if errback is None:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
828 errback = log.error
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
829 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
830 return self.db_core_iface.rosterResync(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
831
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
832 def saveParamsTemplate(self, filename, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
833 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
834 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
835 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
836 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
837 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
838 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
839 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
840 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
841 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
842 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
843 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
844 return self.db_core_iface.saveParamsTemplate(filename, **kwargs)
1015
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
845
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: 2091
diff changeset
846 def sessionInfosGet(self, profile_key, callback=None, errback=None):
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
847 if callback is None:
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
848 error_handler = None
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
849 else:
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
850 if errback is None:
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
851 errback = log.error
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
852 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
853 return self.db_core_iface.sessionInfosGet(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
854
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
855 def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
856 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
857 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
858 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
859 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
860 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
861 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
862 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
863 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
864 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
865 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
866 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
867 return self.db_core_iface.setParam(name, value, category, security_limit, profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
868
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
869 def setPresence(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
870 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
871 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
872 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
873 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
874 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
875 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
876 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
877 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
878 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
879 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
880 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
881 return self.db_core_iface.setPresence(to_jid, show, statuses, profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
882
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
883 def subscription(self, sub_type, entity, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
884 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
885 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
886 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
887 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
888 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
889 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
890 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
891 if callback is not None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
892 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
893 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
894 kwargs['error_handler'] = error_handler
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
895 return self.db_core_iface.subscription(sub_type, entity, profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
896
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
897 def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
898 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
899 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
900 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
901 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
902 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
903 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
3254
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
904 kwargs={}
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
905 if callback is not None:
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
906 kwargs['timeout'] = const_TIMEOUT
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
907 kwargs['reply_handler'] = callback
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
908 kwargs['error_handler'] = error_handler
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
909 return self.db_core_iface.updateContact(entity_jid, name, groups, profile_key, **kwargs)
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
910
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
911
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
912 class AIOBridge(Bridge):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
913
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
914 def register_signal(self, functionName, handler, iface="core"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
915 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
916 async_handler = lambda *args: asyncio.run_coroutine_threadsafe(handler(*args), loop)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
917 return super().register_signal(functionName, async_handler, iface)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
918
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
919 def __getattribute__(self, name):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
920 """ usual __getattribute__ if the method exists, else try to find a plugin method """
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
921 try:
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
922 return object.__getattribute__(self, name)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
923 except AttributeError:
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
924 # The attribute is not found, we try the plugin proxy to find the requested method
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
925 def getPluginMethod(*args, **kwargs):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
926 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
927 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
928 method = getattr(self.db_plugin_iface, name)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
929 reply_handler = lambda ret=None: loop.call_soon_threadsafe(
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
930 fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
931 error_handler = lambda err: loop.call_soon_threadsafe(
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
932 fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
933 method(
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
934 *args,
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
935 **kwargs,
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
936 timeout=const_TIMEOUT,
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
937 reply_handler=reply_handler,
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
938 error_handler=error_handler
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
939 )
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
940 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
941
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
942 return getPluginMethod
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
943
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
944 def bridgeConnect(self):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
945 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
946 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
947 super().bridgeConnect(
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
948 callback=lambda: loop.call_soon_threadsafe(fut.set_result, None),
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
949 errback=lambda e: loop.call_soon_threadsafe(fut.set_exception, e)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
950 )
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
951 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
952
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
953 def actionsGet(self, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
954 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
955 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
956 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
957 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
958 self.db_core_iface.actionsGet(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
959 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
960
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
961 def addContact(self, entity_jid, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
962 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
963 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
964 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
965 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
966 self.db_core_iface.addContact(entity_jid, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
967 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
968
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
969 def asyncDeleteProfile(self, profile):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
970 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
971 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
972 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
973 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
974 self.db_core_iface.asyncDeleteProfile(profile, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
975 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
976
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
977 def asyncGetParamA(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
978 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
979 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
980 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
981 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
982 self.db_core_iface.asyncGetParamA(name, category, attribute, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
983 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
984
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3102
diff changeset
985 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"):
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
986 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
987 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
988 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
989 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3102
diff changeset
990 self.db_core_iface.asyncGetParamsValuesFromCategory(category, security_limit, app, extra, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
991 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
992
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
993 def connect(self, profile_key="@DEFAULT@", password='', options={}):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
994 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
995 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
996 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
997 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
998 self.db_core_iface.connect(profile_key, password, options, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
999 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1000
3254
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
1001 def contactGet(self, arg_0, profile_key="@DEFAULT@"):
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
1002 loop = asyncio.get_running_loop()
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
1003 fut = loop.create_future()
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
1004 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
1005 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
1006 self.db_core_iface.contactGet(arg_0, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
1007 return fut
6cf4bd6972c2 core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents: 3242
diff changeset
1008
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1009 def delContact(self, entity_jid, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1010 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1011 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1012 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1013 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1014 self.db_core_iface.delContact(entity_jid, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1015 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1016
3206
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
1017 def devicesInfosGet(self, bare_jid, profile_key):
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
1018 loop = asyncio.get_running_loop()
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
1019 fut = loop.create_future()
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
1020 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
1021 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
1022 self.db_core_iface.devicesInfosGet(bare_jid, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
1023 return fut
ae09989e9feb core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents: 3201
diff changeset
1024
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1025 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1026 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1027 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1028 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1029 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1030 self.db_core_iface.discoFindByFeatures(namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1031 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1032
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1033 def discoInfos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1034 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1035 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1036 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1037 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1038 self.db_core_iface.discoInfos(entity_jid, node, use_cache, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1039 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1040
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1041 def discoItems(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1042 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1043 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1044 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1045 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1046 self.db_core_iface.discoItems(entity_jid, node, use_cache, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1047 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1048
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1049 def disconnect(self, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1050 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1051 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1052 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1053 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1054 self.db_core_iface.disconnect(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1055 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1056
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1057 def encryptionNamespaceGet(self, arg_0):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1058 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1059 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1060 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1061 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1062 self.db_core_iface.encryptionNamespaceGet(arg_0, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1063 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1064
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1065 def encryptionPluginsGet(self):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1066 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1067 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1068 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1069 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1070 self.db_core_iface.encryptionPluginsGet(timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1071 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1072
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1073 def encryptionTrustUIGet(self, to_jid, namespace, profile_key):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1074 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1075 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1076 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1077 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1078 self.db_core_iface.encryptionTrustUIGet(to_jid, namespace, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1079 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1080
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1081 def getConfig(self, section, name):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1082 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1083 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1084 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1085 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1086 self.db_core_iface.getConfig(section, name, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1087 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1088
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1089 def getContacts(self, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1090 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1091 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1092 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1093 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1094 self.db_core_iface.getContacts(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1095 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1096
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1097 def getContactsFromGroup(self, group, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1098 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1099 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1100 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1101 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1102 self.db_core_iface.getContactsFromGroup(group, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1103 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1104
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1105 def getEntitiesData(self, jids, keys, profile):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1106 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1107 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1108 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1109 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1110 self.db_core_iface.getEntitiesData(jids, keys, profile, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1111 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1112
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1113 def getEntityData(self, jid, keys, profile):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1114 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1115 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1116 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1117 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1118 self.db_core_iface.getEntityData(jid, keys, profile, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1119 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1120
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1121 def getFeatures(self, profile_key):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1122 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1123 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1124 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1125 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1126 self.db_core_iface.getFeatures(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1127 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1128
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1129 def getMainResource(self, contact_jid, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1130 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1131 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1132 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1133 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1134 self.db_core_iface.getMainResource(contact_jid, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1135 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1136
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1137 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1138 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1139 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1140 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1141 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1142 self.db_core_iface.getParamA(name, category, attribute, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1143 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1144
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1145 def getParamsCategories(self):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1146 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1147 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1148 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1149 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1150 self.db_core_iface.getParamsCategories(timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1151 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1152
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3102
diff changeset
1153 def getParamsUI(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@"):
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1154 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1155 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1156 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1157 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
3123
130f9cb6e0ab core (memory/params): added `extra` argument to filter out params notably in `getParamsUI`:
Goffi <goffi@goffi.org>
parents: 3102
diff changeset
1158 self.db_core_iface.getParamsUI(security_limit, app, extra, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1159 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1160
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1161 def getPresenceStatuses(self, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1162 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1163 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1164 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1165 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1166 self.db_core_iface.getPresenceStatuses(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1167 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1168
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1169 def getReady(self):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1170 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1171 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1172 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1173 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1174 self.db_core_iface.getReady(timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1175 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1176
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1177 def getVersion(self):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1178 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1179 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1180 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1181 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1182 self.db_core_iface.getVersion(timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1183 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1184
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1185 def getWaitingSub(self, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1186 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1187 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1188 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1189 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1190 self.db_core_iface.getWaitingSub(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1191 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1192
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1193 def historyGet(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1194 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1195 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1196 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1197 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1198 self.db_core_iface.historyGet(from_jid, to_jid, limit, between, filters, profile, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1199 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1200
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1201 def imageCheck(self, arg_0):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1202 loop = asyncio.get_running_loop()
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1203 fut = loop.create_future()
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1204 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1205 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1206 self.db_core_iface.imageCheck(arg_0, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1207 return fut
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1208
3259
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1209 def imageConvert(self, source, dest, arg_2, extra):
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1210 loop = asyncio.get_running_loop()
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1211 fut = loop.create_future()
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1212 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1213 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1214 self.db_core_iface.imageConvert(source, dest, arg_2, extra, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1215 return fut
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
1216
3201
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1217 def imageGeneratePreview(self, image_path, profile_key):
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1218 loop = asyncio.get_running_loop()
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1219 fut = loop.create_future()
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1220 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1221 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1222 self.db_core_iface.imageGeneratePreview(image_path, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1223 return fut
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3163
diff changeset
1224
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1225 def imageResize(self, image_path, width, height):
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1226 loop = asyncio.get_running_loop()
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1227 fut = loop.create_future()
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1228 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1229 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1230 self.db_core_iface.imageResize(image_path, width, height, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1231 return fut
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3042
diff changeset
1232
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1233 def isConnected(self, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1234 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1235 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1236 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1237 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1238 self.db_core_iface.isConnected(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1239 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1240
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1241 def launchAction(self, callback_id, data, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1242 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1243 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1244 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1245 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1246 self.db_core_iface.launchAction(callback_id, data, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1247 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1248
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1249 def loadParamsTemplate(self, filename):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1250 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1251 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1252 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1253 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1254 self.db_core_iface.loadParamsTemplate(filename, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1255 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1256
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1257 def menuHelpGet(self, menu_id, language):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1258 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1259 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1260 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1261 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1262 self.db_core_iface.menuHelpGet(menu_id, language, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1263 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1264
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1265 def menuLaunch(self, menu_type, path, data, security_limit, profile_key):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1266 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1267 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1268 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1269 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1270 self.db_core_iface.menuLaunch(menu_type, path, data, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1271 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1272
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1273 def menusGet(self, language, security_limit):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1274 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1275 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1276 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1277 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1278 self.db_core_iface.menusGet(language, security_limit, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1279 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1280
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1281 def messageEncryptionGet(self, to_jid, profile_key):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1282 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1283 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1284 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1285 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1286 self.db_core_iface.messageEncryptionGet(to_jid, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1287 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1288
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1289 def messageEncryptionStart(self, to_jid, namespace='', replace=False, profile_key="@NONE@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1290 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1291 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1292 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1293 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1294 self.db_core_iface.messageEncryptionStart(to_jid, namespace, replace, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1295 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1296
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1297 def messageEncryptionStop(self, to_jid, profile_key):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1298 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1299 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1300 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1301 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1302 self.db_core_iface.messageEncryptionStop(to_jid, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1303 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1304
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1305 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1306 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1307 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1308 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1309 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1310 self.db_core_iface.messageSend(to_jid, message, subject, mess_type, extra, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1311 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1312
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1313 def namespacesGet(self):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1314 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1315 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1316 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1317 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1318 self.db_core_iface.namespacesGet(timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1319 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1320
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1321 def paramsRegisterApp(self, xml, security_limit=-1, app=''):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1322 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1323 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1324 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1325 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1326 self.db_core_iface.paramsRegisterApp(xml, security_limit, app, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1327 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1328
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1329 def privateDataDelete(self, namespace, key, arg_2):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1330 loop = asyncio.get_running_loop()
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1331 fut = loop.create_future()
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1332 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1333 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1334 self.db_core_iface.privateDataDelete(namespace, key, arg_2, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1335 return fut
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1336
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1337 def privateDataGet(self, namespace, key, profile_key):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1338 loop = asyncio.get_running_loop()
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1339 fut = loop.create_future()
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1340 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1341 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1342 self.db_core_iface.privateDataGet(namespace, key, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1343 return fut
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1344
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1345 def privateDataSet(self, namespace, key, data, profile_key):
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1346 loop = asyncio.get_running_loop()
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1347 fut = loop.create_future()
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1348 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1349 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1350 self.db_core_iface.privateDataSet(namespace, key, data, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1351 return fut
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
1352
3042
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1353 def profileCreate(self, profile, password='', component=''):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1354 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1355 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1356 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1357 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1358 self.db_core_iface.profileCreate(profile, password, component, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1359 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1360
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1361 def profileIsSessionStarted(self, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1362 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1363 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1364 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1365 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1366 self.db_core_iface.profileIsSessionStarted(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1367 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1368
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1369 def profileNameGet(self, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1370 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1371 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1372 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1373 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1374 self.db_core_iface.profileNameGet(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1375 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1376
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1377 def profileSetDefault(self, profile):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1378 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1379 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1380 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1381 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1382 self.db_core_iface.profileSetDefault(profile, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1383 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1384
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1385 def profileStartSession(self, password='', profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1386 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1387 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1388 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1389 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1390 self.db_core_iface.profileStartSession(password, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1391 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1392
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1393 def profilesListGet(self, clients=True, components=False):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1394 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1395 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1396 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1397 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1398 self.db_core_iface.profilesListGet(clients, components, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1399 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1400
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1401 def progressGet(self, id, profile):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1402 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1403 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1404 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1405 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1406 self.db_core_iface.progressGet(id, profile, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1407 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1408
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1409 def progressGetAll(self, profile):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1410 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1411 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1412 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1413 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1414 self.db_core_iface.progressGetAll(profile, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1415 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1416
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1417 def progressGetAllMetadata(self, profile):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1418 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1419 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1420 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1421 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1422 self.db_core_iface.progressGetAllMetadata(profile, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1423 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1424
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1425 def rosterResync(self, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1426 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1427 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1428 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1429 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1430 self.db_core_iface.rosterResync(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1431 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1432
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1433 def saveParamsTemplate(self, filename):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1434 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1435 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1436 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1437 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1438 self.db_core_iface.saveParamsTemplate(filename, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1439 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1440
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1441 def sessionInfosGet(self, profile_key):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1442 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1443 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1444 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1445 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1446 self.db_core_iface.sessionInfosGet(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1447 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1448
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1449 def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1450 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1451 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1452 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1453 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1454 self.db_core_iface.setParam(name, value, category, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1455 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1456
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1457 def setPresence(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1458 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1459 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1460 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1461 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1462 self.db_core_iface.setPresence(to_jid, show, statuses, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1463 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1464
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1465 def subscription(self, sub_type, entity, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1466 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1467 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1468 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1469 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1470 self.db_core_iface.subscription(sub_type, entity, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1471 return fut
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1472
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1473 def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@"):
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1474 loop = asyncio.get_running_loop()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1475 fut = loop.create_future()
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1476 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1477 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err))
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1478 self.db_core_iface.updateContact(entity_jid, name, groups, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler)
964abd07dc03 bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3039
diff changeset
1479 return fut