annotate sat_frontends/bridge/dbus_bridge.py @ 3028:ab2696e34d29

Python 3 port: /!\ this is a huge commit /!\ starting from this commit, SàT is needs Python 3.6+ /!\ SàT maybe be instable or some feature may not work anymore, this will improve with time This patch port backend, bridge and frontends to Python 3. Roughly this has been done this way: - 2to3 tools has been applied (with python 3.7) - all references to python2 have been replaced with python3 (notably shebangs) - fixed files not handled by 2to3 (notably the shell script) - several manual fixes - fixed issues reported by Python 3 that where not handled in Python 2 - replaced "async" with "async_" when needed (it's a reserved word from Python 3.7) - replaced zope's "implements" with @implementer decorator - temporary hack to handle data pickled in database, as str or bytes may be returned, to be checked later - fixed hash comparison for password - removed some code which is not needed anymore with Python 3 - deactivated some code which needs to be checked (notably certificate validation) - tested with jp, fixed reported issues until some basic commands worked - ported Primitivus (after porting dependencies like urwid satext) - more manual fixes
author Goffi <goffi@goffi.org>
date Tue, 13 Aug 2019 19:08:41 +0200
parents 82b781c46841
children a1bc34f90fa5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
1 #!/usr/bin/env python3
0
goffi@necton2
parents:
diff changeset
2 #-*- coding: utf-8 -*-
goffi@necton2
parents:
diff changeset
3
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
4 # SAT communication bridge
2771
003b8b4b56a7 date update
Goffi <goffi@goffi.org>
parents: 2743
diff changeset
5 # Copyright (C) 2009-2019 Jérôme Poisson (goffi@goffi.org)
0
goffi@necton2
parents:
diff changeset
6
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
7 # This program is free software: you can redistribute it and/or modify
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
10 # (at your option) any later version.
0
goffi@necton2
parents:
diff changeset
11
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
12 # This program is distributed in the hope that it will be useful,
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
15 # GNU Affero General Public License for more details.
0
goffi@necton2
parents:
diff changeset
16
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
0
goffi@necton2
parents:
diff changeset
19
771
bfabeedbf32e core: i18n refactoring:
Goffi <goffi@goffi.org>
parents: 759
diff changeset
20 from sat.core.i18n import _
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
21 from .bridge_frontend import BridgeException
535
790be337cc41 bridge: fixed D-Bus warning in frontend side of bridge
Goffi <goffi@goffi.org>
parents: 504
diff changeset
22 import dbus
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
23 from sat.core.log import getLogger
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
24 log = getLogger(__name__)
627
d207c2186519 core, bridge, jp, quick_frontend: SàT stop more gracefully if bridge can't be initialised:
Goffi <goffi@goffi.org>
parents: 609
diff changeset
25 from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError
0
goffi@necton2
parents:
diff changeset
26
535
790be337cc41 bridge: fixed D-Bus warning in frontend side of bridge
Goffi <goffi@goffi.org>
parents: 504
diff changeset
27 from dbus.mainloop.glib import DBusGMainLoop
790be337cc41 bridge: fixed D-Bus warning in frontend side of bridge
Goffi <goffi@goffi.org>
parents: 504
diff changeset
28 DBusGMainLoop(set_as_default=True)
790be337cc41 bridge: fixed D-Bus warning in frontend side of bridge
Goffi <goffi@goffi.org>
parents: 504
diff changeset
29
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
30 import ast
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
31
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
32 const_INT_PREFIX = "org.salutatoi.SAT" # Interface prefix
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
33 const_ERROR_PREFIX = const_INT_PREFIX + ".error"
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
34 const_OBJ_PATH = '/org/salutatoi/SAT/bridge'
372
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
35 const_CORE_SUFFIX = ".core"
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
36 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
37 const_TIMEOUT = 120
360
6b5626c37909 bridge: regenerated DBus bridge
Goffi <goffi@goffi.org>
parents: 345
diff changeset
38
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
39
1062
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
40 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
41 """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
42
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
43 @param dbus_e (DBusException)
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
44 @return: BridgeException
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
45 """
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
46 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
47 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
48 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
49 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
50 name = full_name
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
51 # 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
52 # 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
53 # 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
54 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
55 try:
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
56 message, condition = ast.literal_eval(message)
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
57 except (SyntaxError, ValueError, TypeError):
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
58 condition = ''
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1072
diff changeset
59 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
60
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1059
diff changeset
61
2167
4b78b4c7f805 core, frontends: various fixes for Libervia:
Goffi <goffi@goffi.org>
parents: 2150
diff changeset
62 class Bridge(object):
2091
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
63
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
64 def bridgeConnect(self, callback, errback):
165
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
65 try:
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
66 self.sessions_bus = dbus.SessionBus()
360
6b5626c37909 bridge: regenerated DBus bridge
Goffi <goffi@goffi.org>
parents: 345
diff changeset
67 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
68 const_OBJ_PATH)
372
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
69 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
70 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
71 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
72 dbus_interface=const_INT_PREFIX + const_PLUGIN_SUFFIX)
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
73 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
74 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
75 'org.freedesktop.DBus.Error.Spawn.ExecFailed'):
2091
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
76 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
77 elif e._dbus_error_name == 'org.freedesktop.DBus.Error.NotSupported':
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
78 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
79 errback(BridgeInitError)
165
8a2053de6f8c Frontends: management of unlaunched SàT Backend (information message and exit)
Goffi <goffi@goffi.org>
parents: 136
diff changeset
80 else:
2091
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
81 errback(e)
f413bfc24458 bridge, quick_frontend: preparation for async bridge
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
82 callback()
372
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
83 #props = self.db_core_iface.getProperties()
0
goffi@necton2
parents:
diff changeset
84
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2083
diff changeset
85 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
86 if iface == "core":
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
87 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
88 elif iface == "plugin":
f964dcec1611 core: plugins refactored according to bridge + updatedValue now use profile
Goffi <goffi@goffi.org>
parents: 365
diff changeset
89 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
90 else:
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
91 log.error(_('Unknown interface'))
0
goffi@necton2
parents:
diff changeset
92
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
93 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
94 """ 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
95 try:
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
96 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
97 except AttributeError:
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
98 # 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
99
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
100 def getPluginMethod(*args, **kwargs):
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
101 # 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
102 # - 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
103 # - 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
104
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
105 async_ = False
1794
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
106 args = list(args)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
107
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
108 if kwargs:
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
109 if 'callback' in kwargs:
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
110 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
111 _callback = kwargs.pop('callback')
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
112 _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
113 try:
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
114 args.append(kwargs.pop('profile'))
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
115 except KeyError:
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
116 try:
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
117 args.append(kwargs.pop('profile_key'))
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
118 except KeyError:
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
119 pass
b0ed4863dbc7 bridge (D-Bus): fixed handling of profile in kwargs:
Goffi <goffi@goffi.org>
parents: 1766
diff changeset
120 # 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
121 if kwargs:
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
122 log.warnings("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
123 elif len(args) >= 2 and callable(args[-1]) and callable(args[-2]):
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
124 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
125 _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
126 _callback = args.pop()
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
127
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
128 method = getattr(self.db_plugin_iface, name)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
129
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
130 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
131 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
132 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
133 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
134
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
135 return method(*args, **kwargs)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
136
568
239abc5484c9 bridge: generic plugin methods handling for frontend side in D-Bus Bridge \o/
Goffi <goffi@goffi.org>
parents: 562
diff changeset
137 return getPluginMethod
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
138
1622
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
139 def actionsGet(self, profile_key="@DEFAULT@", callback=None, errback=None):
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
140 if callback is None:
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
141 error_handler = None
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
142 else:
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
143 if errback is None:
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
144 errback = log.error
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
145 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
146 kwargs={}
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
147 if callback is not None:
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
148 kwargs['timeout'] = const_TIMEOUT
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
149 kwargs['reply_handler'] = callback
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
150 kwargs['error_handler'] = error_handler
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
151 return self.db_core_iface.actionsGet(profile_key, **kwargs)
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1595
diff changeset
152
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
153 def addContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
154 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
155 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
156 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
157 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
158 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
159 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
160 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
161 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
162 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
163 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
164 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
165 return self.db_core_iface.addContact(entity_jid, profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
166
893
308a96bc7c1b core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile
souliane <souliane@mailoo.org>
parents: 811
diff changeset
167 def asyncDeleteProfile(self, profile, callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
168 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
169 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
170 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
171 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
172 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
173 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1237
c1e916594e09 bridge (frontends side): fixed call of async method in blocking context
Goffi <goffi@goffi.org>
parents: 1224
diff changeset
174 return self.db_core_iface.asyncDeleteProfile(profile, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
893
308a96bc7c1b core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile
souliane <souliane@mailoo.org>
parents: 811
diff changeset
175
656
7d6e5807504a bridge, memory: added the parameter security_limit to asyncGetParamA so it can be used from libervia. refactorization in memory.py are related to that.
souliane <souliane@mailoo.org>
parents: 641
diff changeset
176 def asyncGetParamA(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
177 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
178 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
179 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
180 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
181 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
182 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
183 return str(self.db_core_iface.asyncGetParamA(name, category, attribute, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
413
dd4caab17008 core: - individual parameters managed through sqlite
Goffi <goffi@goffi.org>
parents: 405
diff changeset
184
1587
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
185 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
186 if callback is None:
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
187 error_handler = None
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
188 else:
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
189 if errback is None:
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
190 errback = log.error
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
191 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
192 return self.db_core_iface.asyncGetParamsValuesFromCategory(category, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
698d6755d62a core, bridge (params): added asyncGetParamsValuesFromCategory (yes that's a long name!) method to retrive params names and values for a given category
Goffi <goffi@goffi.org>
parents: 1586
diff changeset
193
2142
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
194 def connect(self, profile_key="@DEFAULT@", password='', options={}, callback=None, errback=None):
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
195 if callback is None:
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
196 error_handler = None
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
197 else:
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
198 if errback is None:
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
199 errback = log.error
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
200 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
201 return self.db_core_iface.connect(profile_key, password, options, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
202
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
203 def delContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
204 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
205 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
206 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
207 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
208 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
209 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
210 return self.db_core_iface.delContact(entity_jid, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
211
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
212 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@", callback=None, errback=None):
2534
7da86e1633a5 core: new discoFindFeatures method which return all server services/roster entities implementing a set of features.
Goffi <goffi@goffi.org>
parents: 2483
diff changeset
213 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
214 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
215 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
216 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
217 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
218 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2595
973d4551ffae core: added local_device argument to discoFindByFeatures
Goffi <goffi@goffi.org>
parents: 2562
diff changeset
219 return self.db_core_iface.discoFindByFeatures(namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
2534
7da86e1633a5 core: new discoFindFeatures method which return all server services/roster entities implementing a set of features.
Goffi <goffi@goffi.org>
parents: 2483
diff changeset
220
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
221 def discoInfos(self, entity_jid, node='', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
222 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
223 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
224 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
225 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
226 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
227 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2342
f047d5410040 core (memory/disco): added use_cache parameter to discoInfos/discoItems (set to False to ignore cache)
Goffi <goffi@goffi.org>
parents: 2168
diff changeset
228 return self.db_core_iface.discoInfos(entity_jid, node, use_cache, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
963
723f28cd15c7 core (disco): added discoInfos and discoItems bridge methods
Goffi <goffi@goffi.org>
parents: 943
diff changeset
229
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
230 def discoItems(self, entity_jid, node='', use_cache=True, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
231 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
232 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
233 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
234 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
235 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
236 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2342
f047d5410040 core (memory/disco): added use_cache parameter to discoInfos/discoItems (set to False to ignore cache)
Goffi <goffi@goffi.org>
parents: 2168
diff changeset
237 return self.db_core_iface.discoItems(entity_jid, node, use_cache, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
963
723f28cd15c7 core (disco): added discoInfos and discoItems bridge methods
Goffi <goffi@goffi.org>
parents: 943
diff changeset
238
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
239 def disconnect(self, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
240 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
241 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
242 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
243 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
244 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
245 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2144
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
246 return self.db_core_iface.disconnect(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
247
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
248 def encryptionNamespaceGet(self, arg_0, callback=None, errback=None):
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
249 if callback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
250 error_handler = None
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
251 else:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
252 if errback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
253 errback = log.error
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
254 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
255 kwargs={}
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
256 if callback is not None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
257 kwargs['timeout'] = const_TIMEOUT
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
258 kwargs['reply_handler'] = callback
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
259 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
260 return str(self.db_core_iface.encryptionNamespaceGet(arg_0, **kwargs))
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
261
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
262 def encryptionPluginsGet(self, callback=None, errback=None):
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
263 if callback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
264 error_handler = None
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
265 else:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
266 if errback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
267 errback = log.error
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
268 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
269 kwargs={}
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
270 if callback is not None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
271 kwargs['timeout'] = const_TIMEOUT
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
272 kwargs['reply_handler'] = callback
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
273 kwargs['error_handler'] = error_handler
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
274 return self.db_core_iface.encryptionPluginsGet(**kwargs)
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
275
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
276 def encryptionTrustUIGet(self, to_jid, namespace, profile_key, callback=None, errback=None):
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
277 if callback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
278 error_handler = None
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
279 else:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
280 if errback is None:
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
281 errback = log.error
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
282 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
283 return str(self.db_core_iface.encryptionTrustUIGet(to_jid, namespace, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
284
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
285 def getConfig(self, section, name, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
286 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
287 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
288 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
289 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
290 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
291 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
292 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
293 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
294 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
295 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
296 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
297 return str(self.db_core_iface.getConfig(section, name, **kwargs))
364
312ca6f9d84a core: configuration file
Goffi <goffi@goffi.org>
parents: 362
diff changeset
298
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
299 def getContacts(self, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
300 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
301 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
302 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
303 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
304 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
305 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
306 return self.db_core_iface.getContacts(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
307
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
308 def getContactsFromGroup(self, group, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
309 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
310 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
311 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
312 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
313 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
314 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
315 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
316 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
317 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
318 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
319 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
320 return self.db_core_iface.getContactsFromGroup(group, profile_key, **kwargs)
501
e9634d2e7b38 core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
Goffi <goffi@goffi.org>
parents: 492
diff changeset
321
1314
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
322 def getEntitiesData(self, jids, keys, profile, callback=None, errback=None):
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
323 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
324 error_handler = None
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
325 else:
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
326 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
327 errback = log.error
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
328 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
329 kwargs={}
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
330 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
331 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
332 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
333 kwargs['error_handler'] = error_handler
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
334 return self.db_core_iface.getEntitiesData(jids, keys, profile, **kwargs)
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
335
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
336 def getEntityData(self, jid, keys, profile, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
337 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
338 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
339 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
340 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
341 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
342 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
343 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
344 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
345 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
346 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
347 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
348 return self.db_core_iface.getEntityData(jid, keys, profile, **kwargs)
504
65ecbb473cbb core, quick frontend, plugin xep-0054, bridge: use of memory's entities data for vcard:
Goffi <goffi@goffi.org>
parents: 501
diff changeset
349
1482
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
350 def getFeatures(self, profile_key, callback=None, errback=None):
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
351 if callback is None:
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
352 error_handler = None
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
353 else:
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
354 if errback is None:
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
355 errback = log.error
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
356 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
357 return self.db_core_iface.getFeatures(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1396
diff changeset
358
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
359 def getMainResource(self, contact_jid, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
360 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
361 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
362 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
363 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
364 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
365 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
366 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
367 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
368 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
369 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
370 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
371 return str(self.db_core_iface.getMainResource(contact_jid, profile_key, **kwargs))
399
3ed53803b3b3 core: added getLastResource method
Goffi <goffi@goffi.org>
parents: 387
diff changeset
372
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
373 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
374 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
375 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
376 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
377 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
378 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
379 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
380 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
381 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
382 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
383 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
384 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
385 return str(self.db_core_iface.getParamA(name, category, attribute, profile_key, **kwargs))
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
386
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
387 def getParamsCategories(self, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
388 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
389 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
390 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
391 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
392 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
393 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
394 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
395 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
396 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
397 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
398 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
399 return self.db_core_iface.getParamsCategories(**kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
400
777
5642939d254e core, bridge: new method paramsRegisterApp to register frontend's specific parameters
souliane <souliane@mailoo.org>
parents: 773
diff changeset
401 def getParamsUI(self, security_limit=-1, app='', 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
402 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
403 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
404 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
405 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
406 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
407 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
408 return str(self.db_core_iface.getParamsUI(security_limit, app, 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
409
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
410 def getPresenceStatuses(self, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
411 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
412 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
413 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
414 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
415 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
416 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
417 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
418 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
419 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
420 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
421 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
422 return self.db_core_iface.getPresenceStatuses(profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
423
1024
7e43ea75cce8 bridge (constructor): fixed D-Bus frontend generator for async method without sig_in + fixed --debug option + regenerated bridge to fix bad frontend D-Bus bridge.
Goffi <goffi@goffi.org>
parents: 1023
diff changeset
424 def getReady(self, callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
425 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
426 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
427 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
428 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
429 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
430 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1237
c1e916594e09 bridge (frontends side): fixed call of async method in blocking context
Goffi <goffi@goffi.org>
parents: 1224
diff changeset
431 return self.db_core_iface.getReady(timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
1023
8bae81e254a2 core: added a getReady method which can be called by frontends to ensure that backend is fully initialised before doing anything + this ckeck is automatically done in asyncConnect
Goffi <goffi@goffi.org>
parents: 1015
diff changeset
432
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
433 def getVersion(self, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
434 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
435 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
436 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
437 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
438 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
439 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
440 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
441 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
442 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
443 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
444 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
445 return str(self.db_core_iface.getVersion(**kwargs))
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
446
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
447 def getWaitingSub(self, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
448 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
449 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
450 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
451 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
452 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
453 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
454 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
455 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
456 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
457 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
458 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
459 return self.db_core_iface.getWaitingSub(profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
460
2013
b536dd121da1 backend (memory), frontends: improved history filtering:
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
461 def historyGet(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@", callback=None, errback=None):
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
462 if callback is None:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
463 error_handler = None
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
464 else:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
465 if errback is None:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
466 errback = log.error
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
467 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2013
b536dd121da1 backend (memory), frontends: improved history filtering:
Goffi <goffi@goffi.org>
parents: 1963
diff changeset
468 return self.db_core_iface.historyGet(from_jid, to_jid, limit, between, filters, profile, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
469
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
470 def isConnected(self, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
471 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
472 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
473 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
474 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
475 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
476 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
477 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
478 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
479 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
480 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
481 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
482 return self.db_core_iface.isConnected(profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
483
759
93bd868b8fb6 backend, frontends: callbacks refactoring:
Goffi <goffi@goffi.org>
parents: 755
diff changeset
484 def launchAction(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
485 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
486 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
487 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
488 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
489 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
490 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1237
c1e916594e09 bridge (frontends side): fixed call of async method in blocking context
Goffi <goffi@goffi.org>
parents: 1224
diff changeset
491 return self.db_core_iface.launchAction(callback_id, data, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
492
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
493 def loadParamsTemplate(self, filename, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
494 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
495 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
496 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
497 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
498 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
499 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
500 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
501 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
502 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
503 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
504 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
505 return self.db_core_iface.loadParamsTemplate(filename, **kwargs)
1015
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
506
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
507 def menuHelpGet(self, menu_id, language, callback=None, errback=None):
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
508 if callback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
509 error_handler = None
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
510 else:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
511 if errback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
512 errback = log.error
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
513 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
514 kwargs={}
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
515 if callback is not None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
516 kwargs['timeout'] = const_TIMEOUT
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
517 kwargs['reply_handler'] = callback
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
518 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
519 return str(self.db_core_iface.menuHelpGet(menu_id, language, **kwargs))
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
520
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
521 def menuLaunch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None):
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
522 if callback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
523 error_handler = None
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
524 else:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
525 if errback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
526 errback = log.error
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
527 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
528 return self.db_core_iface.menuLaunch(menu_type, path, data, security_limit, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
529
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
530 def menusGet(self, language, security_limit, callback=None, errback=None):
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
531 if callback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
532 error_handler = None
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
533 else:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
534 if errback is None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
535 errback = log.error
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
536 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
537 kwargs={}
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
538 if callback is not None:
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
539 kwargs['timeout'] = const_TIMEOUT
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
540 kwargs['reply_handler'] = callback
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
541 kwargs['error_handler'] = error_handler
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
542 return self.db_core_iface.menusGet(language, security_limit, **kwargs)
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
543
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
544 def messageEncryptionGet(self, to_jid, profile_key, callback=None, errback=None):
2646
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
545 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
546 error_handler = None
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
547 else:
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
548 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
549 errback = log.error
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
550 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
551 kwargs={}
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
552 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
553 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
554 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
555 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
556 return str(self.db_core_iface.messageEncryptionGet(to_jid, profile_key, **kwargs))
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
557
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
558 def messageEncryptionStart(self, to_jid, namespace='', replace=False, profile_key="@NONE@", callback=None, errback=None):
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
559 if callback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
560 error_handler = None
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
561 else:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
562 if errback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
563 errback = log.error
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
564 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2743
da59ff099b32 core (memory/encryption), plugin OTR: finished OTR integration in encryption:
Goffi <goffi@goffi.org>
parents: 2733
diff changeset
565 return self.db_core_iface.messageEncryptionStart(to_jid, namespace, replace, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
566
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
567 def messageEncryptionStop(self, to_jid, profile_key, callback=None, errback=None):
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
568 if callback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
569 error_handler = None
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
570 else:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
571 if errback is None:
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
572 errback = log.error
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
573 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
2743
da59ff099b32 core (memory/encryption), plugin OTR: finished OTR integration in encryption:
Goffi <goffi@goffi.org>
parents: 2733
diff changeset
574 return self.db_core_iface.messageEncryptionStop(to_jid, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
2646
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
575
1963
a2bc5089c2eb backend, frontends: message refactoring (huge commit):
Goffi <goffi@goffi.org>
parents: 1955
diff changeset
576 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
577 if callback is None:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
578 error_handler = None
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
579 else:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
580 if errback is None:
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
581 errback = log.error
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
582 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
583 return self.db_core_iface.messageSend(to_jid, message, subject, mess_type, extra, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
584
2443
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
585 def namespacesGet(self, callback=None, errback=None):
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
586 if callback is None:
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
587 error_handler = None
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
588 else:
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
589 if errback is None:
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
590 errback = log.error
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
591 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
592 kwargs={}
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
593 if callback is not None:
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
594 kwargs['timeout'] = const_TIMEOUT
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
595 kwargs['reply_handler'] = callback
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
596 kwargs['error_handler'] = error_handler
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
597 return self.db_core_iface.namespacesGet(**kwargs)
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
598
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
599 def paramsRegisterApp(self, xml, security_limit=-1, app='', callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
600 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
601 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
602 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
603 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
604 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
605 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
606 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
607 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
608 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
609 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
610 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
611 return self.db_core_iface.paramsRegisterApp(xml, security_limit, app, **kwargs)
777
5642939d254e core, bridge: new method paramsRegisterApp to register frontend's specific parameters
souliane <souliane@mailoo.org>
parents: 773
diff changeset
612
2144
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
613 def profileCreate(self, profile, password='', component='', callback=None, errback=None):
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
614 if callback is None:
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
615 error_handler = None
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
616 else:
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
617 if errback is None:
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
618 errback = log.error
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
619 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
620 return self.db_core_iface.profileCreate(profile, password, component, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
621
1592
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
622 def profileIsSessionStarted(self, profile_key="@DEFAULT@", callback=None, errback=None):
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
623 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
624 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
625 else:
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
626 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
627 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
628 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
629 kwargs={}
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
630 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
631 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
632 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
633 kwargs['error_handler'] = error_handler
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
634 return self.db_core_iface.profileIsSessionStarted(profile_key, **kwargs)
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
635
2168
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
636 def profileNameGet(self, profile_key="@DEFAULT@", callback=None, errback=None):
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
637 if callback is None:
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
638 error_handler = None
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
639 else:
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
640 if errback is None:
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
641 errback = log.error
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
642 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
643 kwargs={}
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
644 if callback is not None:
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
645 kwargs['timeout'] = const_TIMEOUT
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
646 kwargs['reply_handler'] = callback
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
647 kwargs['error_handler'] = error_handler
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
648 return str(self.db_core_iface.profileNameGet(profile_key, **kwargs))
2168
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2167
diff changeset
649
2083
7999d5299ddc bridge(D-Bus): minotr argument name fix
Goffi <goffi@goffi.org>
parents: 2050
diff changeset
650 def profileSetDefault(self, profile, callback=None, errback=None):
1595
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
651 if callback is None:
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
652 error_handler = None
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
653 else:
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
654 if errback is None:
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
655 errback = log.error
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
656 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
657 kwargs={}
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
658 if callback is not None:
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
659 kwargs['timeout'] = const_TIMEOUT
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
660 kwargs['reply_handler'] = callback
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
661 kwargs['error_handler'] = error_handler
2083
7999d5299ddc bridge(D-Bus): minotr argument name fix
Goffi <goffi@goffi.org>
parents: 2050
diff changeset
662 return self.db_core_iface.profileSetDefault(profile, **kwargs)
1595
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
663
1592
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
664 def profileStartSession(self, password='', profile_key="@DEFAULT@", callback=None, errback=None):
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
665 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
666 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
667 else:
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
668 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
669 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
670 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
671 return self.db_core_iface.profileStartSession(password, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
672
2146
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
673 def profilesListGet(self, clients=True, components=False, callback=None, errback=None):
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
674 if callback is None:
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
675 error_handler = None
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
676 else:
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
677 if errback is None:
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
678 errback = log.error
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
679 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
680 kwargs={}
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
681 if callback is not None:
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
682 kwargs['timeout'] = const_TIMEOUT
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
683 kwargs['reply_handler'] = callback
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
684 kwargs['error_handler'] = error_handler
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
685 return self.db_core_iface.profilesListGet(clients, components, **kwargs)
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
686
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
687 def progressGet(self, id, profile, callback=None, errback=None):
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
688 if callback is None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
689 error_handler = None
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
690 else:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
691 if errback is None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
692 errback = log.error
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
693 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
694 kwargs={}
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
695 if callback is not None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
696 kwargs['timeout'] = const_TIMEOUT
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
697 kwargs['reply_handler'] = callback
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
698 kwargs['error_handler'] = error_handler
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
699 return self.db_core_iface.progressGet(id, profile, **kwargs)
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
700
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
701 def progressGetAll(self, profile, callback=None, errback=None):
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
702 if callback is None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
703 error_handler = None
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
704 else:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
705 if errback is None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
706 errback = log.error
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
707 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
708 kwargs={}
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
709 if callback is not None:
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
710 kwargs['timeout'] = const_TIMEOUT
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
711 kwargs['reply_handler'] = callback
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
712 kwargs['error_handler'] = error_handler
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
713 return self.db_core_iface.progressGetAll(profile, **kwargs)
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
714
1626
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
715 def progressGetAllMetadata(self, profile, callback=None, errback=None):
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
716 if callback is None:
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
717 error_handler = None
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
718 else:
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
719 if errback is None:
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
720 errback = log.error
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
721 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
722 kwargs={}
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
723 if callback is not None:
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
724 kwargs['timeout'] = const_TIMEOUT
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
725 kwargs['reply_handler'] = callback
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
726 kwargs['error_handler'] = error_handler
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
727 return self.db_core_iface.progressGetAllMetadata(profile, **kwargs)
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
728
2892
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
729 def rosterResync(self, profile_key="@DEFAULT@", callback=None, errback=None):
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
730 if callback is None:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
731 error_handler = None
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
732 else:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
733 if errback is None:
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
734 errback = log.error
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
735 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
736 return self.db_core_iface.rosterResync(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
82b781c46841 core: added a rosterResync method to bridge:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
737
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
738 def saveParamsTemplate(self, filename, callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
739 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
740 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
741 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
742 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
743 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
744 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
745 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
746 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
747 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
748 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
749 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
750 return self.db_core_iface.saveParamsTemplate(filename, **kwargs)
1015
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
751
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
752 def sessionInfosGet(self, profile_key, callback=None, errback=None):
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
753 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
754 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
755 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
756 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
757 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
758 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
759 return self.db_core_iface.sessionInfosGet(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2091
diff changeset
760
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
761 def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
762 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
763 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
764 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
765 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
766 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
767 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
768 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
769 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
770 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
771 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
772 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
773 return self.db_core_iface.setParam(name, value, category, security_limit, profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
774
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
775 def setPresence(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@", callback=None, errback=None):
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
776 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
777 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
778 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
779 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
780 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
781 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
782 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
783 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
784 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
785 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
786 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
787 return self.db_core_iface.setPresence(to_jid, show, statuses, profile_key, **kwargs)
272
1d2e0dfe7114 bridge: core & frontend sides of bridge are now generated
Goffi <goffi@goffi.org>
parents: 267
diff changeset
788
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
789 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
790 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
791 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
792 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
793 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
794 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
795 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
796 kwargs={}
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
797 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
798 kwargs['timeout'] = const_TIMEOUT
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
799 kwargs['reply_handler'] = callback
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
800 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
801 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
802
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
803 def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@", callback=None, errback=None):
1290
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
804 if callback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
805 error_handler = None
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
806 else:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
807 if errback is None:
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
808 errback = log.error
faa1129559b8 core, frontends: refactoring to base Libervia on QuickFrontend (big mixed commit):
Goffi <goffi@goffi.org>
parents: 1265
diff changeset
809 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
1265
e3a9ea76de35 quick_frontend, primitivus: multi-profiles refactoring part 1 (big commit, sorry :p):
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
810 return self.db_core_iface.updateContact(entity_jid, name, groups, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)