Mercurial > libervia-backend
annotate libervia/frontends/bridge/dbus_bridge.py @ 4263:2109d864a3e7
plugin XEP-470: Don't file configuration on `feature-not-implemented`.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 12 Jun 2024 22:35:13 +0200 |
parents | 730f542e4ad0 |
children | 0d7bb4df2343 |
rev | line source |
---|---|
3028 | 1 #!/usr/bin/env python3 |
0 | 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 | 4 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org) |
0 | 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 | 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 | 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 | 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 |
4071
4b842c1fb686
refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents:
4041
diff
changeset
|
22 from libervia.backend.core.i18n import _ |
4b842c1fb686
refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents:
4041
diff
changeset
|
23 from libervia.backend.tools import config |
4b842c1fb686
refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents:
4041
diff
changeset
|
24 from libervia.backend.core.log import getLogger |
4b842c1fb686
refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents:
4041
diff
changeset
|
25 from libervia.backend.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 | 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 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
35 const_INT_PREFIX = config.config_get( |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
36 config.parse_main_conf(), |
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
|
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 | 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 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
69 class bridge: |
2091
f413bfc24458
bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents:
2086
diff
changeset
|
70 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
71 def bridge_connect(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 | 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 | 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': |
4193
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
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 | 92 |
2086 | 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 | 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 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
108 def get_plugin_method(*args, **kwargs): |
568
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 | 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 | 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 | 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 | 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 | 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 |
3648
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
143 try: |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
144 return method(*args, **kwargs) |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
145 except ValueError as e: |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
146 if e.args[0].startswith("Unable to guess signature"): |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
147 # XXX: if frontend is started too soon after backend, the |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
148 # inspection misses methods (notably plugin dynamically added |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
149 # methods). The following hack works around that by redoing the |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
150 # cache of introspected methods signatures. |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
151 log.debug("using hack to work around inspection issue") |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
152 proxy = self.db_plugin_iface.proxy_object |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
153 IN_PROGRESS = proxy.INTROSPECT_STATE_INTROSPECT_IN_PROGRESS |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
154 proxy._introspect_state = IN_PROGRESS |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
155 proxy._Introspect() |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
156 return self.db_plugin_iface.get_dbus_method(name)(*args, **kwargs) |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
157 raise e |
587
952322b1d490
Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
572
diff
changeset
|
158 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
159 return get_plugin_method |
1290
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
160 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
161 def action_launch(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
162 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
163 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
164 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
165 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
166 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
167 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4041
2594e1951cf7
core (bridge): `action_new` now use serialised dict for extra data.
Goffi <goffi@goffi.org>
parents:
4037
diff
changeset
|
168 return str(self.db_core_iface.action_launch(callback_id, data, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
169 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
170 def actions_get(self, profile_key="@DEFAULT@", callback=None, errback=None): |
1622 | 171 if callback is None: |
172 error_handler = None | |
173 else: | |
174 if errback is None: | |
175 errback = log.error | |
176 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) | |
177 kwargs={} | |
178 if callback is not None: | |
179 kwargs['timeout'] = const_TIMEOUT | |
180 kwargs['reply_handler'] = callback | |
181 kwargs['error_handler'] = error_handler | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
182 return self.db_core_iface.actions_get(profile_key, **kwargs) |
1622 | 183 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
184 def config_get(self, section, name, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
185 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
186 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
187 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
188 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
189 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
190 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
191 kwargs={} |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
192 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
193 kwargs['timeout'] = const_TIMEOUT |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
194 kwargs['reply_handler'] = callback |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
195 kwargs['error_handler'] = error_handler |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
196 return str(self.db_core_iface.config_get(section, name, **kwargs)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
197 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
198 def connect(self, profile_key="@DEFAULT@", password='', options={}, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
199 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
200 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
201 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
202 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
203 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
204 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
205 return self.db_core_iface.connect(profile_key, password, options, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
206 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
207 def contact_add(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
|
208 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
209 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
210 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
211 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
212 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
213 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
|
214 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
215 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
|
216 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
217 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
218 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
219 return self.db_core_iface.contact_add(entity_jid, profile_key, **kwargs) |
413
dd4caab17008
core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents:
405
diff
changeset
|
220 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
221 def contact_del(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None): |
3254
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
222 if callback is None: |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
223 error_handler = None |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
224 else: |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
225 if errback is None: |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
226 errback = log.error |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
227 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
228 return self.db_core_iface.contact_del(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
|
229 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
230 def contact_get(self, arg_0, 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
|
231 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
|
232 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
|
233 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
|
234 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
|
235 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
|
236 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
237 return self.db_core_iface.contact_get(arg_0, 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
|
238 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
239 def contact_update(self, entity_jid, name, groups, profile_key="@DEFAULT@", callback=None, errback=None): |
2733
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
240 if callback is None: |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
241 error_handler = None |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
242 else: |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
243 if errback is None: |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
244 errback = log.error |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
245 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
|
246 kwargs={} |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
247 if callback is not None: |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
248 kwargs['timeout'] = const_TIMEOUT |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
249 kwargs['reply_handler'] = callback |
e347e32aa07f
core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents:
2658
diff
changeset
|
250 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
251 return self.db_core_iface.contact_update(entity_jid, name, groups, profile_key, **kwargs) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
252 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
253 def contacts_get(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
254 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
255 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
256 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
257 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
258 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
259 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
260 return self.db_core_iface.contacts_get(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
261 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
262 def contacts_get_from_group(self, group, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
263 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
264 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
265 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
266 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
267 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
268 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
269 kwargs={} |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
270 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
271 kwargs['timeout'] = const_TIMEOUT |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
272 kwargs['reply_handler'] = callback |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
273 kwargs['error_handler'] = error_handler |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
274 return self.db_core_iface.contacts_get_from_group(group, profile_key, **kwargs) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
275 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
276 def devices_infos_get(self, bare_jid, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
277 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
278 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
279 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
280 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
281 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
282 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
283 return str(self.db_core_iface.devices_infos_get(bare_jid, 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
|
284 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
285 def disco_find_by_features(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
286 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
287 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
288 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
289 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
290 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
291 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
292 return self.db_core_iface.disco_find_by_features(namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
293 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
294 def disco_infos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
295 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
296 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
297 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
298 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
299 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
300 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
301 return self.db_core_iface.disco_infos(entity_jid, node, use_cache, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
302 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
303 def disco_items(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
304 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
305 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
306 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
307 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
308 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
309 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
310 return self.db_core_iface.disco_items(entity_jid, node, use_cache, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
311 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
312 def disconnect(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
313 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
314 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
315 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
316 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
317 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
318 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
319 return self.db_core_iface.disconnect(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
320 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
321 def encryption_namespace_get(self, arg_0, callback=None, errback=None): |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
322 if callback is None: |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
323 error_handler = None |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
324 else: |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
325 if errback is None: |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
326 errback = log.error |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
327 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
|
328 kwargs={} |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
329 if callback is not None: |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
330 kwargs['timeout'] = const_TIMEOUT |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
331 kwargs['reply_handler'] = callback |
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
332 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
333 return str(self.db_core_iface.encryption_namespace_get(arg_0, **kwargs)) |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
334 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
335 def encryption_plugins_get(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
|
336 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
337 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
338 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
339 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
340 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
341 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
|
342 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
343 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
|
344 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
345 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
346 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
347 return str(self.db_core_iface.encryption_plugins_get(**kwargs)) |
364 | 348 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
349 def encryption_trust_ui_get(self, to_jid, namespace, profile_key, 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
|
350 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
351 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
352 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
353 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
354 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
355 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
356 return str(self.db_core_iface.encryption_trust_ui_get(to_jid, namespace, 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
|
357 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
358 def entities_data_get(self, jids, keys, 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
|
359 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
360 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
361 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
362 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
363 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
364 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
|
365 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
366 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
|
367 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
368 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
369 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
370 return self.db_core_iface.entities_data_get(jids, keys, profile, **kwargs) |
501
e9634d2e7b38
core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
Goffi <goffi@goffi.org>
parents:
492
diff
changeset
|
371 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
372 def entity_data_get(self, jid, keys, profile, callback=None, errback=None): |
1314
bb9c32249778
core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents:
1290
diff
changeset
|
373 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
|
374 error_handler = None |
bb9c32249778
core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents:
1290
diff
changeset
|
375 else: |
bb9c32249778
core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents:
1290
diff
changeset
|
376 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
|
377 errback = log.error |
bb9c32249778
core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents:
1290
diff
changeset
|
378 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
|
379 kwargs={} |
bb9c32249778
core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents:
1290
diff
changeset
|
380 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
|
381 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
|
382 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
|
383 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
384 return self.db_core_iface.entity_data_get(jid, keys, profile, **kwargs) |
1314
bb9c32249778
core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents:
1290
diff
changeset
|
385 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
386 def features_get(self, profile_key, 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
|
387 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
388 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
389 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
390 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
391 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
392 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
393 return self.db_core_iface.features_get(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
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
|
394 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
395 def history_get(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@", callback=None, errback=None): |
1482
80cd55dd5b04
core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents:
1396
diff
changeset
|
396 if callback is None: |
80cd55dd5b04
core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents:
1396
diff
changeset
|
397 error_handler = None |
80cd55dd5b04
core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents:
1396
diff
changeset
|
398 else: |
80cd55dd5b04
core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents:
1396
diff
changeset
|
399 if errback is None: |
80cd55dd5b04
core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents:
1396
diff
changeset
|
400 errback = log.error |
80cd55dd5b04
core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents:
1396
diff
changeset
|
401 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
402 return self.db_core_iface.history_get(from_jid, to_jid, limit, between, filters, profile, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
1482
80cd55dd5b04
core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents:
1396
diff
changeset
|
403 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
404 def image_check(self, arg_0, 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
|
405 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
406 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
407 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
408 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
409 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
410 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
|
411 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
412 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
|
413 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
414 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
415 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
416 return str(self.db_core_iface.image_check(arg_0, **kwargs)) |
399 | 417 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
418 def image_convert(self, source, dest, arg_2, extra, 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
|
419 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
420 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
421 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
422 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
423 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
424 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
425 return str(self.db_core_iface.image_convert(source, dest, arg_2, extra, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
426 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
427 def image_generate_preview(self, image_path, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
428 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
429 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
430 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
431 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
432 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
433 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
434 return str(self.db_core_iface.image_generate_preview(image_path, 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 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
436 def image_resize(self, image_path, width, height, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
437 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
438 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
439 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
440 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
441 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
442 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
443 return str(self.db_core_iface.image_resize(image_path, width, height, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
444 |
4193
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
445 def init_pre_script(self, callback=None, errback=None): |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
446 if callback is None: |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
447 error_handler = None |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
448 else: |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
449 if errback is None: |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
450 errback = log.error |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
451 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
452 return self.db_core_iface.init_pre_script(timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
453 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
454 def is_connected(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
|
455 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
456 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
457 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
458 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
459 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
460 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
|
461 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
462 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
|
463 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
464 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
465 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
466 return self.db_core_iface.is_connected(profile_key, **kwargs) |
272
1d2e0dfe7114
bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
467 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
468 def main_resource_get(self, contact_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
|
469 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
470 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
471 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
472 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
473 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
474 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
|
475 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
476 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
|
477 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
478 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
479 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
480 return str(self.db_core_iface.main_resource_get(contact_jid, profile_key, **kwargs)) |
272
1d2e0dfe7114
bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
481 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
482 def menu_help_get(self, menu_id, language, 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
|
483 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
484 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
485 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
486 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
487 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
488 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
|
489 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
490 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
|
491 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
492 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
493 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
494 return str(self.db_core_iface.menu_help_get(menu_id, language, **kwargs)) |
272
1d2e0dfe7114
bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
495 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
496 def menu_launch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
497 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
498 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
499 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
500 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
501 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
502 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
503 return self.db_core_iface.menu_launch(menu_type, path, data, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
504 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
505 def menus_get(self, language, security_limit, 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
|
506 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
507 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
508 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
509 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
510 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
511 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
|
512 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
513 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
|
514 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
515 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
516 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
517 return self.db_core_iface.menus_get(language, security_limit, **kwargs) |
272
1d2e0dfe7114
bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
518 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
519 def message_encryption_get(self, to_jid, profile_key, callback=None, errback=None): |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
520 if callback is None: |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
521 error_handler = None |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
522 else: |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
523 if errback is None: |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
524 errback = log.error |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
525 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
|
526 kwargs={} |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
527 if callback is not None: |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
528 kwargs['timeout'] = const_TIMEOUT |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
529 kwargs['reply_handler'] = callback |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
530 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
531 return str(self.db_core_iface.message_encryption_get(to_jid, profile_key, **kwargs)) |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
532 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
533 def message_encryption_start(self, to_jid, namespace='', replace=False, profile_key="@NONE@", callback=None, errback=None): |
3259
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
534 if callback is None: |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
535 error_handler = None |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
536 else: |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
537 if errback is None: |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
538 errback = log.error |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
539 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
540 return self.db_core_iface.message_encryption_start(to_jid, namespace, replace, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
3259
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
541 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
542 def message_encryption_stop(self, to_jid, profile_key, callback=None, errback=None): |
3201
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
543 if callback is None: |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
544 error_handler = None |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
545 else: |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
546 if errback is None: |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
547 errback = log.error |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
548 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
549 return self.db_core_iface.message_encryption_stop(to_jid, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
3201
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
550 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
551 def message_send(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None): |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
552 if callback is None: |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
553 error_handler = None |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
554 else: |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
555 if errback is None: |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
556 errback = log.error |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
557 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
558 return self.db_core_iface.message_send(to_jid, message, subject, mess_type, extra, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
559 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
560 def namespaces_get(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
|
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 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
572 return self.db_core_iface.namespaces_get(**kwargs) |
272
1d2e0dfe7114
bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
573 |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
574 def notification_add(self, type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra, callback=None, errback=None): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
575 if callback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
576 error_handler = None |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
577 else: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
578 if errback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
579 errback = log.error |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
580 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
581 kwargs={} |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
582 if callback is not None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
583 kwargs['timeout'] = const_TIMEOUT |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
584 kwargs['reply_handler'] = callback |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
585 kwargs['error_handler'] = error_handler |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
586 return self.db_core_iface.notification_add(type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra, **kwargs) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
587 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
588 def notification_delete(self, id_, is_global, profile_key, callback=None, errback=None): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
589 if callback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
590 error_handler = None |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
591 else: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
592 if errback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
593 errback = log.error |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
594 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
595 kwargs={} |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
596 if callback is not None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
597 kwargs['timeout'] = const_TIMEOUT |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
598 kwargs['reply_handler'] = callback |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
599 kwargs['error_handler'] = error_handler |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
600 return self.db_core_iface.notification_delete(id_, is_global, profile_key, **kwargs) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
601 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
602 def notifications_expired_clean(self, limit_timestamp, profile_key, callback=None, errback=None): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
603 if callback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
604 error_handler = None |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
605 else: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
606 if errback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
607 errback = log.error |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
608 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
609 kwargs={} |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
610 if callback is not None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
611 kwargs['timeout'] = const_TIMEOUT |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
612 kwargs['reply_handler'] = callback |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
613 kwargs['error_handler'] = error_handler |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
614 return self.db_core_iface.notifications_expired_clean(limit_timestamp, profile_key, **kwargs) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
615 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
616 def notifications_get(self, filters, profile_key, callback=None, errback=None): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
617 if callback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
618 error_handler = None |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
619 else: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
620 if errback is None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
621 errback = log.error |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
622 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
623 kwargs={} |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
624 if callback is not None: |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
625 kwargs['timeout'] = const_TIMEOUT |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
626 kwargs['reply_handler'] = callback |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
627 kwargs['error_handler'] = error_handler |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
628 return str(self.db_core_iface.notifications_get(filters, profile_key, **kwargs)) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
629 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
630 def param_get_a(self, name, category, attribute="value", 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
|
631 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
632 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
633 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
634 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
635 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
636 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
|
637 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
638 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
|
639 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
640 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
641 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
642 return str(self.db_core_iface.param_get_a(name, category, attribute, profile_key, **kwargs)) |
1015
fee00f2e11c2
memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents:
993
diff
changeset
|
643 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
644 def param_get_a_async(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
645 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
646 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
647 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
648 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
649 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
650 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
651 return str(self.db_core_iface.param_get_a_async(name, category, attribute, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
652 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
653 def param_set(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None): |
2126 | 654 if callback is None: |
655 error_handler = None | |
656 else: | |
657 if errback is None: | |
658 errback = log.error | |
659 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) | |
660 kwargs={} | |
661 if callback is not None: | |
662 kwargs['timeout'] = const_TIMEOUT | |
663 kwargs['reply_handler'] = callback | |
664 kwargs['error_handler'] = error_handler | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
665 return self.db_core_iface.param_set(name, value, category, security_limit, profile_key, **kwargs) |
2126 | 666 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
667 def param_ui_get(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@", callback=None, errback=None): |
2126 | 668 if callback is None: |
669 error_handler = None | |
670 else: | |
671 if errback is None: | |
672 errback = log.error | |
673 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
674 return str(self.db_core_iface.param_ui_get(security_limit, app, extra, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)) |
2126 | 675 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
676 def params_categories_get(self, callback=None, errback=None): |
2126 | 677 if callback is None: |
678 error_handler = None | |
679 else: | |
680 if errback is None: | |
681 errback = log.error | |
682 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) | |
683 kwargs={} | |
684 if callback is not None: | |
685 kwargs['timeout'] = const_TIMEOUT | |
686 kwargs['reply_handler'] = callback | |
687 kwargs['error_handler'] = error_handler | |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
688 return self.db_core_iface.params_categories_get(**kwargs) |
2126 | 689 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
690 def params_register_app(self, xml, security_limit=-1, app='', 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
|
691 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
|
692 error_handler = None |
712cb4ff3e13
core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents:
2628
diff
changeset
|
693 else: |
712cb4ff3e13
core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents:
2628
diff
changeset
|
694 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
|
695 errback = log.error |
712cb4ff3e13
core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents:
2628
diff
changeset
|
696 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
|
697 kwargs={} |
712cb4ff3e13
core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents:
2628
diff
changeset
|
698 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
|
699 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
|
700 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
|
701 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
702 return self.db_core_iface.params_register_app(xml, security_limit, app, **kwargs) |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2646
diff
changeset
|
703 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
704 def params_template_load(self, filename, callback=None, errback=None): |
2443
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
705 if callback is None: |
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
706 error_handler = None |
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
707 else: |
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
708 if errback is None: |
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
709 errback = log.error |
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
710 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
|
711 kwargs={} |
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
712 if callback is not None: |
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
713 kwargs['timeout'] = const_TIMEOUT |
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
714 kwargs['reply_handler'] = callback |
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
715 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
716 return self.db_core_iface.params_template_load(filename, **kwargs) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
717 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
718 def params_template_save(self, filename, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
719 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
720 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
721 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
722 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
723 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
724 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
725 kwargs={} |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
726 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
727 kwargs['timeout'] = const_TIMEOUT |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
728 kwargs['reply_handler'] = callback |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
729 kwargs['error_handler'] = error_handler |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
730 return self.db_core_iface.params_template_save(filename, **kwargs) |
2443
81a45e7886c9
core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents:
2414
diff
changeset
|
731 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
732 def params_values_from_category_get_async(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
733 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
734 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
735 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
736 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
737 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
738 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
739 return self.db_core_iface.params_values_from_category_get_async(category, security_limit, app, extra, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
740 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
741 def presence_set(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
742 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
743 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
744 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
745 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
746 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
747 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
748 kwargs={} |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
749 if callback is not None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
750 kwargs['timeout'] = const_TIMEOUT |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
751 kwargs['reply_handler'] = callback |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
752 kwargs['error_handler'] = error_handler |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
753 return self.db_core_iface.presence_set(to_jid, show, statuses, profile_key, **kwargs) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
754 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
755 def presence_statuses_get(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
|
756 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
757 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
758 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
759 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
760 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
761 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
|
762 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
763 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
|
764 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
765 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
766 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
767 return self.db_core_iface.presence_statuses_get(profile_key, **kwargs) |
777
5642939d254e
core, bridge: new method paramsRegisterApp to register frontend's specific parameters
souliane <souliane@mailoo.org>
parents:
773
diff
changeset
|
768 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
769 def private_data_delete(self, namespace, key, arg_2, callback=None, errback=None): |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
770 if callback is None: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
771 error_handler = None |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
772 else: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
773 if errback is None: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
774 errback = log.error |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
775 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
776 return self.db_core_iface.private_data_delete(namespace, key, arg_2, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
777 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
778 def private_data_get(self, namespace, key, profile_key, callback=None, errback=None): |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
779 if callback is None: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
780 error_handler = None |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
781 else: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
782 if errback is None: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
783 errback = log.error |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
784 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
785 return str(self.db_core_iface.private_data_get(namespace, key, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
786 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
787 def private_data_set(self, namespace, key, data, profile_key, callback=None, errback=None): |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
788 if callback is None: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
789 error_handler = None |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
790 else: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
791 if errback is None: |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
792 errback = log.error |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
793 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
794 return self.db_core_iface.private_data_set(namespace, key, data, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
795 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
796 def profile_create(self, profile, password='', component='', callback=None, errback=None): |
2144
1d3f73e065e1
core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents:
2142
diff
changeset
|
797 if callback is None: |
1d3f73e065e1
core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents:
2142
diff
changeset
|
798 error_handler = None |
1d3f73e065e1
core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents:
2142
diff
changeset
|
799 else: |
1d3f73e065e1
core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents:
2142
diff
changeset
|
800 if errback is None: |
1d3f73e065e1
core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents:
2142
diff
changeset
|
801 errback = log.error |
1d3f73e065e1
core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents:
2142
diff
changeset
|
802 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
803 return self.db_core_iface.profile_create(profile, password, component, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
2144
1d3f73e065e1
core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents:
2142
diff
changeset
|
804 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
805 def profile_delete_async(self, profile, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
806 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
807 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
808 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
809 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
810 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
811 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
812 return self.db_core_iface.profile_delete_async(profile, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
813 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
814 def profile_is_session_started(self, profile_key="@DEFAULT@", callback=None, errback=None): |
1592
d6d655238a93
bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents:
1587
diff
changeset
|
815 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
|
816 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
|
817 else: |
d6d655238a93
bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents:
1587
diff
changeset
|
818 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
|
819 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
|
820 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
|
821 kwargs={} |
d6d655238a93
bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents:
1587
diff
changeset
|
822 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
|
823 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
|
824 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
|
825 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
826 return self.db_core_iface.profile_is_session_started(profile_key, **kwargs) |
1592
d6d655238a93
bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents:
1587
diff
changeset
|
827 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
828 def profile_name_get(self, profile_key="@DEFAULT@", callback=None, errback=None): |
2168
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
829 if callback is None: |
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
830 error_handler = None |
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
831 else: |
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
832 if errback is None: |
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
833 errback = log.error |
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
834 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
|
835 kwargs={} |
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
836 if callback is not None: |
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
837 kwargs['timeout'] = const_TIMEOUT |
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
838 kwargs['reply_handler'] = callback |
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
839 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
840 return str(self.db_core_iface.profile_name_get(profile_key, **kwargs)) |
2168
255830fdb80b
core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents:
2167
diff
changeset
|
841 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
842 def profile_set_default(self, profile, callback=None, errback=None): |
2146
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
843 if callback is None: |
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
844 error_handler = None |
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
845 else: |
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
846 if errback is None: |
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
847 errback = log.error |
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
848 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
|
849 kwargs={} |
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
850 if callback is not None: |
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
851 kwargs['timeout'] = const_TIMEOUT |
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
852 kwargs['reply_handler'] = callback |
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
853 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
854 return self.db_core_iface.profile_set_default(profile, **kwargs) |
2146
1bb9bf1b4150
core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents:
2144
diff
changeset
|
855 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
856 def profile_start_session(self, password='', profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
857 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
858 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
859 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
860 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
861 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
862 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
863 return self.db_core_iface.profile_start_session(password, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
864 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
865 def profiles_list_get(self, clients=True, components=False, callback=None, errback=None): |
1522
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
866 if callback is None: |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
867 error_handler = None |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
868 else: |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
869 if errback is None: |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
870 errback = log.error |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
871 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
872 kwargs={} |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
873 if callback is not None: |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
874 kwargs['timeout'] = const_TIMEOUT |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
875 kwargs['reply_handler'] = callback |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
876 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
877 return self.db_core_iface.profiles_list_get(clients, components, **kwargs) |
1522
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
878 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
879 def progress_get(self, id, profile, callback=None, errback=None): |
1522
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
880 if callback is None: |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
881 error_handler = None |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
882 else: |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
883 if errback is None: |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
884 errback = log.error |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
885 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
886 kwargs={} |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
887 if callback is not None: |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
888 kwargs['timeout'] = const_TIMEOUT |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
889 kwargs['reply_handler'] = callback |
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
890 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
891 return self.db_core_iface.progress_get(id, profile, **kwargs) |
1522
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
892 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
893 def progress_get_all(self, profile, callback=None, errback=None): |
1626
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
894 if callback is None: |
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
895 error_handler = None |
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
896 else: |
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
897 if errback is None: |
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
898 errback = log.error |
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
899 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
|
900 kwargs={} |
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
901 if callback is not None: |
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
902 kwargs['timeout'] = const_TIMEOUT |
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
903 kwargs['reply_handler'] = callback |
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
904 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
905 return self.db_core_iface.progress_get_all(profile, **kwargs) |
1626
63cef4dbf2a4
core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents:
1622
diff
changeset
|
906 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
907 def progress_get_all_metadata(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
|
908 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
909 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
910 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
911 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
912 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
913 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
|
914 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
915 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
|
916 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
917 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
918 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
919 return self.db_core_iface.progress_get_all_metadata(profile, **kwargs) |
1015
fee00f2e11c2
memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents:
993
diff
changeset
|
920 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
921 def ready_get(self, callback=None, errback=None): |
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
|
922 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
|
923 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
|
924 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
|
925 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
|
926 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
|
927 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
928 return self.db_core_iface.ready_get(timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
929 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
930 def roster_resync(self, profile_key="@DEFAULT@", callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
931 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
932 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
933 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
934 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
935 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
936 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
937 return self.db_core_iface.roster_resync(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
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
|
938 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
939 def session_infos_get(self, profile_key, callback=None, errback=None): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
940 if callback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
941 error_handler = None |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
942 else: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
943 if errback is None: |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
944 errback = log.error |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
945 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
946 return self.db_core_iface.session_infos_get(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
947 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
948 def sub_waiting_get(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
|
949 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
950 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
951 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
952 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
953 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
954 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
|
955 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
956 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
|
957 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
958 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
959 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
960 return self.db_core_iface.sub_waiting_get(profile_key, **kwargs) |
272
1d2e0dfe7114
bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents:
267
diff
changeset
|
961 |
1290
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
962 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
|
963 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
964 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
965 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
966 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
967 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
968 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
|
969 kwargs={} |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
970 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
|
971 kwargs['timeout'] = const_TIMEOUT |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
972 kwargs['reply_handler'] = callback |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
973 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
|
974 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
|
975 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
976 def version_get(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
|
977 if callback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
978 error_handler = None |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
979 else: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
980 if errback is None: |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
981 errback = log.error |
faa1129559b8
core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents:
1265
diff
changeset
|
982 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
3254
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
983 kwargs={} |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
984 if callback is not None: |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
985 kwargs['timeout'] = const_TIMEOUT |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
986 kwargs['reply_handler'] = callback |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
987 kwargs['error_handler'] = error_handler |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
988 return str(self.db_core_iface.version_get(**kwargs)) |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
989 |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
990 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
991 class AIOBridge(bridge): |
3042
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 register_signal(self, functionName, handler, iface="core"): |
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 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
|
996 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
|
997 |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
998 def __getattribute__(self, name): |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
999 """ 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
|
1000 try: |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1001 return object.__getattribute__(self, name) |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1002 except AttributeError: |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1003 # The attribute is not found, we try the plugin proxy to find the requested method |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1004 def get_plugin_method(*args, **kwargs): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1005 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1006 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1007 method = getattr(self.db_plugin_iface, name) |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1008 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
|
1009 fut.set_result, ret) |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1010 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
|
1011 fut.set_exception, dbus_to_bridge_exception(err)) |
3648
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1012 try: |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1013 method( |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1014 *args, |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1015 **kwargs, |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1016 timeout=const_TIMEOUT, |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1017 reply_handler=reply_handler, |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1018 error_handler=error_handler |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1019 ) |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1020 except ValueError as e: |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1021 if e.args[0].startswith("Unable to guess signature"): |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1022 # same hack as for bridge.__getattribute__ |
3648
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1023 log.warning("using hack to work around inspection issue") |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1024 proxy = self.db_plugin_iface.proxy_object |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1025 IN_PROGRESS = proxy.INTROSPECT_STATE_INTROSPECT_IN_PROGRESS |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1026 proxy._introspect_state = IN_PROGRESS |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1027 proxy._Introspect() |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1028 self.db_plugin_iface.get_dbus_method(name)( |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1029 *args, |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1030 **kwargs, |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1031 timeout=const_TIMEOUT, |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1032 reply_handler=reply_handler, |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1033 error_handler=error_handler |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1034 ) |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1035 |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1036 else: |
71cfe9334f73
bridge (dbus/frontend): reintrospect signature in case of guess error:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
1037 raise e |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1038 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1039 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1040 return get_plugin_method |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1041 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1042 def bridge_connect(self): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1043 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1044 fut = loop.create_future() |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1045 super().bridge_connect( |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1046 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
|
1047 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
|
1048 ) |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1049 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1050 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1051 def action_launch(self, callback_id, data, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1052 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1053 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1054 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
|
1055 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1056 self.db_core_iface.action_launch(callback_id, data, 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
|
1057 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1058 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1059 def actions_get(self, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1060 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1061 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1062 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
|
1063 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1064 self.db_core_iface.actions_get(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
|
1065 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1066 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1067 def config_get(self, section, name): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1068 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1069 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1070 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
|
1071 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1072 self.db_core_iface.config_get(section, name, 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
|
1073 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1074 |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1075 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
|
1076 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1077 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1078 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
|
1079 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
|
1080 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
|
1081 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1082 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1083 def contact_add(self, entity_jid, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1084 loop = asyncio.get_running_loop() |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1085 fut = loop.create_future() |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1086 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1087 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1088 self.db_core_iface.contact_add(entity_jid, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1089 return fut |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1090 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1091 def contact_del(self, entity_jid, profile_key="@DEFAULT@"): |
3254
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
1092 loop = asyncio.get_running_loop() |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
1093 fut = loop.create_future() |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
1094 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
|
1095 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1096 self.db_core_iface.contact_del(entity_jid, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
3254
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
1097 return fut |
6cf4bd6972c2
core, frontends: avatar refactoring:
Goffi <goffi@goffi.org>
parents:
3242
diff
changeset
|
1098 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1099 def contact_get(self, arg_0, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1100 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1101 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1102 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
|
1103 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1104 self.db_core_iface.contact_get(arg_0, 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
|
1105 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1106 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1107 def contact_update(self, entity_jid, name, groups, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1108 loop = asyncio.get_running_loop() |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1109 fut = loop.create_future() |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1110 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1111 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1112 self.db_core_iface.contact_update(entity_jid, name, groups, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1113 return fut |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1114 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1115 def contacts_get(self, profile_key="@DEFAULT@"): |
3206
ae09989e9feb
core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents:
3201
diff
changeset
|
1116 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
|
1117 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
|
1118 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
|
1119 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1120 self.db_core_iface.contacts_get(profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
3206
ae09989e9feb
core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
Goffi <goffi@goffi.org>
parents:
3201
diff
changeset
|
1121 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
|
1122 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1123 def contacts_get_from_group(self, group, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1124 loop = asyncio.get_running_loop() |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1125 fut = loop.create_future() |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1126 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1127 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1128 self.db_core_iface.contacts_get_from_group(group, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1129 return fut |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1130 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1131 def devices_infos_get(self, bare_jid, profile_key): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1132 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1133 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1134 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
|
1135 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1136 self.db_core_iface.devices_infos_get(bare_jid, 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
|
1137 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1138 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1139 def disco_find_by_features(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1140 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1141 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1142 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
|
1143 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1144 self.db_core_iface.disco_find_by_features(namespaces, identities, bare_jid, service, roster, own_jid, local_device, 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
|
1145 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1146 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1147 def disco_infos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1148 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1149 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1150 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
|
1151 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1152 self.db_core_iface.disco_infos(entity_jid, node, use_cache, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1153 return fut |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1154 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1155 def disco_items(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1156 loop = asyncio.get_running_loop() |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1157 fut = loop.create_future() |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1158 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1159 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1160 self.db_core_iface.disco_items(entity_jid, node, use_cache, 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
|
1161 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1162 |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1163 def disconnect(self, profile_key="@DEFAULT@"): |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1164 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1165 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1166 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
|
1167 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
|
1168 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
|
1169 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1170 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1171 def encryption_namespace_get(self, arg_0): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1172 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1173 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1174 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
|
1175 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1176 self.db_core_iface.encryption_namespace_get(arg_0, 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
|
1177 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1178 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1179 def encryption_plugins_get(self): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1180 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1181 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1182 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
|
1183 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1184 self.db_core_iface.encryption_plugins_get(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
|
1185 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1186 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1187 def encryption_trust_ui_get(self, to_jid, namespace, profile_key): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1188 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1189 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1190 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
|
1191 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1192 self.db_core_iface.encryption_trust_ui_get(to_jid, namespace, 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
|
1193 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1194 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1195 def entities_data_get(self, jids, keys, profile): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1196 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1197 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1198 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
|
1199 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1200 self.db_core_iface.entities_data_get(jids, keys, profile, 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
|
1201 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1202 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1203 def entity_data_get(self, jid, keys, profile): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1204 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1205 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1206 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
|
1207 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1208 self.db_core_iface.entity_data_get(jid, keys, profile, 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
|
1209 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1210 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1211 def features_get(self, profile_key): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1212 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1213 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1214 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
|
1215 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1216 self.db_core_iface.features_get(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
|
1217 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1218 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1219 def history_get(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1220 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1221 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1222 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
|
1223 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1224 self.db_core_iface.history_get(from_jid, to_jid, limit, between, filters, profile, 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
|
1225 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1226 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1227 def image_check(self, arg_0): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1228 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1229 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1230 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
|
1231 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1232 self.db_core_iface.image_check(arg_0, 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
|
1233 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1234 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1235 def image_convert(self, source, dest, arg_2, extra): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1236 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1237 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1238 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
|
1239 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1240 self.db_core_iface.image_convert(source, dest, arg_2, extra, 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
|
1241 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1242 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1243 def image_generate_preview(self, image_path, profile_key): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1244 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1245 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1246 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
|
1247 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1248 self.db_core_iface.image_generate_preview(image_path, 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
|
1249 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1250 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1251 def image_resize(self, image_path, width, height): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1252 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1253 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1254 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
|
1255 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1256 self.db_core_iface.image_resize(image_path, width, height, 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
|
1257 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1258 |
4193
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
1259 def init_pre_script(self): |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
1260 loop = asyncio.get_running_loop() |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
1261 fut = loop.create_future() |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
1262 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
1263 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
1264 self.db_core_iface.init_pre_script(timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
1265 return fut |
730f542e4ad0
core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents:
4147
diff
changeset
|
1266 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1267 def is_connected(self, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1268 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1269 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1270 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
|
1271 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1272 self.db_core_iface.is_connected(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
|
1273 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1274 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1275 def main_resource_get(self, contact_jid, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1276 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1277 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1278 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
|
1279 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1280 self.db_core_iface.main_resource_get(contact_jid, 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
|
1281 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1282 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1283 def menu_help_get(self, menu_id, language): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1284 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1285 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1286 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
|
1287 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1288 self.db_core_iface.menu_help_get(menu_id, language, 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
|
1289 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1290 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1291 def menu_launch(self, menu_type, path, data, security_limit, profile_key): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1292 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1293 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1294 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
|
1295 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1296 self.db_core_iface.menu_launch(menu_type, path, data, security_limit, 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
|
1297 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1298 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1299 def menus_get(self, language, security_limit): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1300 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1301 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1302 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
|
1303 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1304 self.db_core_iface.menus_get(language, security_limit, 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
|
1305 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1306 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1307 def message_encryption_get(self, to_jid, profile_key): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1308 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1309 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1310 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
|
1311 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1312 self.db_core_iface.message_encryption_get(to_jid, 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
|
1313 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1314 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1315 def message_encryption_start(self, to_jid, namespace='', replace=False, profile_key="@NONE@"): |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1316 loop = asyncio.get_running_loop() |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1317 fut = loop.create_future() |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1318 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
|
1319 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1320 self.db_core_iface.message_encryption_start(to_jid, namespace, replace, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1321 return fut |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1322 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1323 def message_encryption_stop(self, to_jid, profile_key): |
3259
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
1324 loop = asyncio.get_running_loop() |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
1325 fut = loop.create_future() |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
1326 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
|
1327 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1328 self.db_core_iface.message_encryption_stop(to_jid, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
3259
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
1329 return fut |
f300d78f08f3
core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents:
3254
diff
changeset
|
1330 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1331 def message_send(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@"): |
3201
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
1332 loop = asyncio.get_running_loop() |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
1333 fut = loop.create_future() |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
1334 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
|
1335 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1336 self.db_core_iface.message_send(to_jid, message, subject, mess_type, extra, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
3201
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
1337 return fut |
439e2f88c3a9
core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents:
3163
diff
changeset
|
1338 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1339 def namespaces_get(self): |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1340 loop = asyncio.get_running_loop() |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1341 fut = loop.create_future() |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1342 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
|
1343 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1344 self.db_core_iface.namespaces_get(timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
3066
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1345 return fut |
2cc2f65379f7
core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents:
3042
diff
changeset
|
1346 |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1347 def notification_add(self, type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1348 loop = asyncio.get_running_loop() |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1349 fut = loop.create_future() |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1350 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1351 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1352 self.db_core_iface.notification_add(type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1353 return fut |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1354 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1355 def notification_delete(self, id_, is_global, profile_key): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1356 loop = asyncio.get_running_loop() |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1357 fut = loop.create_future() |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1358 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1359 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1360 self.db_core_iface.notification_delete(id_, is_global, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1361 return fut |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1362 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1363 def notifications_expired_clean(self, limit_timestamp, profile_key): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1364 loop = asyncio.get_running_loop() |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1365 fut = loop.create_future() |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1366 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1367 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1368 self.db_core_iface.notifications_expired_clean(limit_timestamp, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1369 return fut |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1370 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1371 def notifications_get(self, filters, profile_key): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1372 loop = asyncio.get_running_loop() |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1373 fut = loop.create_future() |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1374 reply_handler = lambda ret=None: loop.call_soon_threadsafe(fut.set_result, ret) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1375 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1376 self.db_core_iface.notifications_get(filters, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1377 return fut |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4074
diff
changeset
|
1378 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1379 def param_get_a(self, name, category, attribute="value", profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1380 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1381 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1382 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
|
1383 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1384 self.db_core_iface.param_get_a(name, category, attribute, 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
|
1385 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1386 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1387 def param_get_a_async(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1388 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1389 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1390 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
|
1391 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1392 self.db_core_iface.param_get_a_async(name, category, attribute, security_limit, 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
|
1393 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1394 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1395 def param_set(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1396 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1397 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1398 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
|
1399 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1400 self.db_core_iface.param_set(name, value, category, security_limit, 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
|
1401 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1402 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1403 def param_ui_get(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
|
1404 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1405 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1406 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
|
1407 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1408 self.db_core_iface.param_ui_get(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
|
1409 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1410 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1411 def params_categories_get(self): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1412 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1413 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1414 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
|
1415 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1416 self.db_core_iface.params_categories_get(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
|
1417 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1418 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1419 def params_register_app(self, xml, security_limit=-1, app=''): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1420 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1421 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1422 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
|
1423 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1424 self.db_core_iface.params_register_app(xml, security_limit, app, 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
|
1425 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1426 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1427 def params_template_load(self, filename): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1428 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1429 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1430 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
|
1431 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1432 self.db_core_iface.params_template_load(filename, 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
|
1433 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1434 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1435 def params_template_save(self, filename): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1436 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1437 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1438 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
|
1439 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1440 self.db_core_iface.params_template_save(filename, 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
|
1441 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1442 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1443 def params_values_from_category_get_async(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
|
1444 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1445 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1446 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
|
1447 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1448 self.db_core_iface.params_values_from_category_get_async(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
|
1449 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1450 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1451 def presence_set(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1452 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1453 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1454 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
|
1455 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1456 self.db_core_iface.presence_set(to_jid, show, statuses, 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
|
1457 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1458 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1459 def presence_statuses_get(self, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1460 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1461 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1462 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
|
1463 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1464 self.db_core_iface.presence_statuses_get(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
|
1465 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1466 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1467 def private_data_delete(self, namespace, key, arg_2): |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1468 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
|
1469 fut = loop.create_future() |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1470 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
|
1471 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1472 self.db_core_iface.private_data_delete(namespace, key, arg_2, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1473 return fut |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1474 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1475 def private_data_get(self, namespace, key, profile_key): |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1476 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
|
1477 fut = loop.create_future() |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1478 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
|
1479 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1480 self.db_core_iface.private_data_get(namespace, key, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1481 return fut |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1482 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1483 def private_data_set(self, namespace, key, data, profile_key): |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1484 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
|
1485 fut = loop.create_future() |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1486 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
|
1487 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1488 self.db_core_iface.private_data_set(namespace, key, data, profile_key, timeout=const_TIMEOUT, reply_handler=reply_handler, error_handler=error_handler) |
3163
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1489 return fut |
d10b2368684e
bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents:
3143
diff
changeset
|
1490 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1491 def profile_create(self, profile, password='', component=''): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1492 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1493 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1494 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
|
1495 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1496 self.db_core_iface.profile_create(profile, password, component, 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
|
1497 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1498 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1499 def profile_delete_async(self, profile): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1500 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1501 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1502 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
|
1503 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1504 self.db_core_iface.profile_delete_async(profile, 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
|
1505 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1506 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1507 def profile_is_session_started(self, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1508 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1509 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1510 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
|
1511 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1512 self.db_core_iface.profile_is_session_started(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
|
1513 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1514 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1515 def profile_name_get(self, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1516 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1517 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1518 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
|
1519 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1520 self.db_core_iface.profile_name_get(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
|
1521 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1522 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1523 def profile_set_default(self, profile): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1524 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1525 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1526 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
|
1527 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1528 self.db_core_iface.profile_set_default(profile, 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
|
1529 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1530 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1531 def profile_start_session(self, password='', profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1532 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1533 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1534 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
|
1535 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1536 self.db_core_iface.profile_start_session(password, 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
|
1537 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1538 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1539 def profiles_list_get(self, clients=True, components=False): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1540 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1541 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1542 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
|
1543 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1544 self.db_core_iface.profiles_list_get(clients, components, 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
|
1545 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1546 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1547 def progress_get(self, id, profile): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1548 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1549 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1550 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
|
1551 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1552 self.db_core_iface.progress_get(id, profile, 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
|
1553 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1554 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1555 def progress_get_all(self, profile): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1556 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1557 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1558 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
|
1559 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1560 self.db_core_iface.progress_get_all(profile, 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
|
1561 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1562 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1563 def progress_get_all_metadata(self, profile): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1564 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1565 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1566 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
|
1567 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1568 self.db_core_iface.progress_get_all_metadata(profile, 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
|
1569 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1570 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1571 def ready_get(self): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1572 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1573 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1574 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
|
1575 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1576 self.db_core_iface.ready_get(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
|
1577 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1578 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1579 def roster_resync(self, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1580 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1581 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1582 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
|
1583 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1584 self.db_core_iface.roster_resync(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
|
1585 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1586 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1587 def session_infos_get(self, profile_key): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1588 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1589 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1590 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
|
1591 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1592 self.db_core_iface.session_infos_get(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
|
1593 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1594 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1595 def sub_waiting_get(self, profile_key="@DEFAULT@"): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1596 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1597 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1598 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
|
1599 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1600 self.db_core_iface.sub_waiting_get(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
|
1601 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1602 |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1603 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
|
1604 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1605 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1606 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
|
1607 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
|
1608 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
|
1609 return fut |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1610 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1611 def version_get(self): |
3042
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1612 loop = asyncio.get_running_loop() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1613 fut = loop.create_future() |
964abd07dc03
bridge (dbus): AsyncIO version of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3039
diff
changeset
|
1614 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
|
1615 error_handler = lambda err: loop.call_soon_threadsafe(fut.set_exception, dbus_to_bridge_exception(err)) |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3648
diff
changeset
|
1616 self.db_core_iface.version_get(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
|
1617 return fut |