annotate libervia/backend/bridge/dbus_bridge.py @ 4203:4af030d4d3d8

frontends (tools): module to handle display servers: rel 433
author Goffi <goffi@goffi.org>
date Tue, 16 Jan 2024 10:41:58 +0100
parents 730f542e4ad0
children 0d7bb4df2343
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3028
ab2696e34d29 Python 3 port:
Goffi <goffi@goffi.org>
parents: 2894
diff changeset
1 #!/usr/bin/env python3
3137
559a625a236b fixed shebangs
Goffi <goffi@goffi.org>
parents: 3136
diff changeset
2
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
3 # Libervia communication bridge
3479
be6d91572633 date update
Goffi <goffi@goffi.org>
parents: 3259
diff changeset
4 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org)
0
goffi@necton2
parents:
diff changeset
5
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
6 # This program is free software: you can redistribute it and/or modify
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
7 # it under the terms of the GNU Affero General Public License as published by
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
8 # the Free Software Foundation, either version 3 of the License, or
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
9 # (at your option) any later version.
0
goffi@necton2
parents:
diff changeset
10
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
11 # This program is distributed in the hope that it will be useful,
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
14 # GNU Affero General Public License for more details.
0
goffi@necton2
parents:
diff changeset
15
609
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
16 # You should have received a copy of the GNU Affero General Public License
84a6e83157c2 fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents: 595
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
0
goffi@necton2
parents:
diff changeset
18
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
19 from types import MethodType
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
20 from functools import partialmethod
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
21 from twisted.internet import defer, reactor
4071
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4041
diff changeset
22 from libervia.backend.core.i18n import _
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4041
diff changeset
23 from libervia.backend.core.log import getLogger
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4041
diff changeset
24 from libervia.backend.core.exceptions import BridgeInitError
4b842c1fb686 refactoring: renamed `sat` package to `libervia.backend`
Goffi <goffi@goffi.org>
parents: 4041
diff changeset
25 from libervia.backend.tools import config
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
26 from txdbus import client, objects, error
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
27 from txdbus.interface import DBusInterface, Method, Signal
0
goffi@necton2
parents:
diff changeset
28
3143
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
29
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
30 log = getLogger(__name__)
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
31
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
32 # Interface prefix
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
33 const_INT_PREFIX = config.config_get(
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
34 config.parse_main_conf(),
3143
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
35 "",
830fce0db15d bridge (dbus): new `bridge_dbus_int_prefix` option (in `[DEFAULT]` settings) to change interface prefix
Goffi <goffi@goffi.org>
parents: 3137
diff changeset
36 "bridge_dbus_int_prefix",
3480
7550ae9cfbac Renamed the project from "Salut à Toi" to "Libervia":
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
37 "org.libervia.Libervia")
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
38 const_ERROR_PREFIX = const_INT_PREFIX + ".error"
3480
7550ae9cfbac Renamed the project from "Salut à Toi" to "Libervia":
Goffi <goffi@goffi.org>
parents: 3479
diff changeset
39 const_OBJ_PATH = "/org/libervia/Libervia/bridge"
371
3ea41a199b36 bridge refactoring: categories are now core and plugin instead of communication and request
Goffi <goffi@goffi.org>
parents: 365
diff changeset
40 const_CORE_SUFFIX = ".core"
3ea41a199b36 bridge refactoring: categories are now core and plugin instead of communication and request
Goffi <goffi@goffi.org>
parents: 365
diff changeset
41 const_PLUGIN_SUFFIX = ".plugin"
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
42
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
43
477
031b0e0aaab8 plugin groupblog: subscriptions/notifications
Goffi <goffi@goffi.org>
parents: 469
diff changeset
44 class ParseError(Exception):
031b0e0aaab8 plugin groupblog: subscriptions/notifications
Goffi <goffi@goffi.org>
parents: 469
diff changeset
45 pass
031b0e0aaab8 plugin groupblog: subscriptions/notifications
Goffi <goffi@goffi.org>
parents: 469
diff changeset
46
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
47
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
48 class DBusException(Exception):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
49 pass
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
50
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
51
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
52 class MethodNotRegistered(DBusException):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
53 dbusErrorName = const_ERROR_PREFIX + ".MethodNotRegistered"
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
54
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
55
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
56 class GenericException(DBusException):
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
57 def __init__(self, twisted_error):
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
58 """
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
59
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
60 @param twisted_error (Failure): instance of twisted Failure
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
61 error message is used to store a repr of message and condition in a tuple,
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
62 so it can be evaluated by the frontend bridge.
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
63 """
751
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
64 try:
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
65 # twisted_error.value is a class
1062
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1060
diff changeset
66 class_ = twisted_error.value().__class__
751
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
67 except TypeError:
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
68 # twisted_error.value is an instance
1062
95758ef3faa8 bridge: async failures are more detailed (full class name + error message)
souliane <souliane@mailoo.org>
parents: 1060
diff changeset
69 class_ = twisted_error.value.__class__
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
70 data = twisted_error.getErrorMessage()
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
71 try:
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
72 data = (data, twisted_error.value.condition)
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
73 except AttributeError:
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
74 data = (data,)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
75 else:
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
76 data = (str(twisted_error),)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
77 self.dbusErrorName = ".".join(
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
78 (const_ERROR_PREFIX, class_.__module__, class_.__name__)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
79 )
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
80 super(GenericException, self).__init__(repr(data))
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
81
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
82 @classmethod
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
83 def create_and_raise(cls, exc):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
84 raise cls(exc)
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
85
419
6c167a2e04b8 bridge: added generic D-Bus exception management + asyncCreateProfile method
Goffi <goffi@goffi.org>
parents: 413
diff changeset
86
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
87 class DBusObject(objects.DBusObject):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
88
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
89 core_iface = DBusInterface(
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
90 const_INT_PREFIX + const_CORE_SUFFIX,
4041
2594e1951cf7 core (bridge): `action_new` now use serialised dict for extra data.
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
91 Method('action_launch', arguments='sss', returns='s'),
2594e1951cf7 core (bridge): `action_new` now use serialised dict for extra data.
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
92 Method('actions_get', arguments='s', returns='a(ssi)'),
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
93 Method('config_get', arguments='ss', returns='s'),
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
94 Method('connect', arguments='ssa{ss}', returns='b'),
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
95 Method('contact_add', arguments='ss', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
96 Method('contact_del', arguments='ss', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
97 Method('contact_get', arguments='ss', returns='(a{ss}as)'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
98 Method('contact_update', arguments='ssass', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
99 Method('contacts_get', arguments='s', returns='a(sa{ss}as)'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
100 Method('contacts_get_from_group', arguments='ss', returns='as'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
101 Method('devices_infos_get', arguments='ss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
102 Method('disco_find_by_features', arguments='asa(ss)bbbbbs', returns='(a{sa(sss)}a{sa(sss)}a{sa(sss)})'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
103 Method('disco_infos', arguments='ssbs', returns='(asa(sss)a{sa(a{ss}as)})'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
104 Method('disco_items', arguments='ssbs', returns='a(sss)'),
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
105 Method('disconnect', arguments='s', returns=''),
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
106 Method('encryption_namespace_get', arguments='s', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
107 Method('encryption_plugins_get', arguments='', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
108 Method('encryption_trust_ui_get', arguments='sss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
109 Method('entities_data_get', arguments='asass', returns='a{sa{ss}}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
110 Method('entity_data_get', arguments='sass', returns='a{ss}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
111 Method('features_get', arguments='s', returns='a{sa{ss}}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
112 Method('history_get', arguments='ssiba{ss}s', returns='a(sdssa{ss}a{ss}ss)'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
113 Method('image_check', arguments='s', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
114 Method('image_convert', arguments='ssss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
115 Method('image_generate_preview', arguments='ss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
116 Method('image_resize', arguments='sii', returns='s'),
4193
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4148
diff changeset
117 Method('init_pre_script', arguments='', returns=''),
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
118 Method('is_connected', arguments='s', returns='b'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
119 Method('main_resource_get', arguments='ss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
120 Method('menu_help_get', arguments='ss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
121 Method('menu_launch', arguments='sasa{ss}is', returns='a{ss}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
122 Method('menus_get', arguments='si', returns='a(ssasasa{ss})'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
123 Method('message_encryption_get', arguments='ss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
124 Method('message_encryption_start', arguments='ssbs', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
125 Method('message_encryption_stop', arguments='ss', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
126 Method('message_send', arguments='sa{ss}a{ss}sss', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
127 Method('namespaces_get', arguments='', returns='a{ss}'),
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
128 Method('notification_add', arguments='ssssbbsdss', returns=''),
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
129 Method('notification_delete', arguments='sbs', returns=''),
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
130 Method('notifications_expired_clean', arguments='ds', returns=''),
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
131 Method('notifications_get', arguments='ss', returns='s'),
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
132 Method('param_get_a', arguments='ssss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
133 Method('param_get_a_async', arguments='sssis', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
134 Method('param_set', arguments='sssis', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
135 Method('param_ui_get', arguments='isss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
136 Method('params_categories_get', arguments='', returns='as'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
137 Method('params_register_app', arguments='sis', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
138 Method('params_template_load', arguments='s', returns='b'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
139 Method('params_template_save', arguments='s', returns='b'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
140 Method('params_values_from_category_get_async', arguments='sisss', returns='a{ss}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
141 Method('presence_set', arguments='ssa{ss}s', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
142 Method('presence_statuses_get', arguments='s', returns='a{sa{s(sia{ss})}}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
143 Method('private_data_delete', arguments='sss', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
144 Method('private_data_get', arguments='sss', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
145 Method('private_data_set', arguments='ssss', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
146 Method('profile_create', arguments='sss', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
147 Method('profile_delete_async', arguments='s', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
148 Method('profile_is_session_started', arguments='s', returns='b'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
149 Method('profile_name_get', arguments='s', returns='s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
150 Method('profile_set_default', arguments='s', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
151 Method('profile_start_session', arguments='ss', returns='b'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
152 Method('profiles_list_get', arguments='bb', returns='as'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
153 Method('progress_get', arguments='ss', returns='a{ss}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
154 Method('progress_get_all', arguments='s', returns='a{sa{sa{ss}}}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
155 Method('progress_get_all_metadata', arguments='s', returns='a{sa{sa{ss}}}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
156 Method('ready_get', arguments='', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
157 Method('roster_resync', arguments='s', returns=''),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
158 Method('session_infos_get', arguments='s', returns='a{ss}'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
159 Method('sub_waiting_get', arguments='s', returns='a{ss}'),
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
160 Method('subscription', arguments='sss', returns=''),
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
161 Method('version_get', arguments='', returns='s'),
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
162 Signal('_debug', 'sa{ss}s'),
4041
2594e1951cf7 core (bridge): `action_new` now use serialised dict for extra data.
Goffi <goffi@goffi.org>
parents: 4037
diff changeset
163 Signal('action_new', 'ssis'),
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
164 Signal('connected', 'ss'),
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
165 Signal('contact_deleted', 'ss'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
166 Signal('contact_new', 'sa{ss}ass'),
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
167 Signal('disconnected', 's'),
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
168 Signal('entity_data_updated', 'ssss'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
169 Signal('message_encryption_started', 'sss'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
170 Signal('message_encryption_stopped', 'sa{ss}s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
171 Signal('message_new', 'sdssa{ss}a{ss}sss'),
4148
a8a0fa678ce2 bridge: add `message_update` signal
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
172 Signal('message_update', 'ssss'),
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
173 Signal('notification_deleted', 'ss'),
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
174 Signal('notification_new', 'sdssssbidss'),
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
175 Signal('param_update', 'ssss'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
176 Signal('presence_update', 'ssia{ss}s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
177 Signal('progress_error', 'sss'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
178 Signal('progress_finished', 'sa{ss}s'),
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
179 Signal('progress_started', 'sa{ss}s'),
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
180 Signal('subscribe', 'sss'),
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
181 )
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
182 plugin_iface = DBusInterface(
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
183 const_INT_PREFIX + const_PLUGIN_SUFFIX
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
184 )
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
185
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
186 dbusInterfaces = [core_iface, plugin_iface]
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
187
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
188 def __init__(self, path):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
189 super().__init__(path)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
190 log.debug("Init DBusObject...")
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
191 self.cb = {}
0
goffi@necton2
parents:
diff changeset
192
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
193 def register_method(self, name, cb):
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
194 self.cb[name] = cb
0
goffi@necton2
parents:
diff changeset
195
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
196 def _callback(self, name, *args, **kwargs):
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
197 """Call the callback if it exists, raise an exception else"""
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
198 try:
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
199 cb = self.cb[name]
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
200 except KeyError:
423
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
201 raise MethodNotRegistered
6c20c76abdcc backend: - bridge async D-Bus method now automatically manage callback and errback, we just have to return a deferred
Goffi <goffi@goffi.org>
parents: 419
diff changeset
202 else:
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
203 d = defer.maybeDeferred(cb, *args, **kwargs)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
204 d.addErrback(GenericException.create_and_raise)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
205 return d
1467
ceba6fd77739 core, bridge: new signal actionNew to launch an action from the backend (e.g. display a dialog message):
Goffi <goffi@goffi.org>
parents: 1435
diff changeset
206
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
207 def dbus_action_launch(self, callback_id, data, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
208 return self._callback("action_launch", callback_id, data, profile_key)
2655
b8600f8130ac core (bridge): new messageEncryptionStarted and messageEncryptionStopped signals (not used yet)
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
209
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
210 def dbus_actions_get(self, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
211 return self._callback("actions_get", profile_key)
0
goffi@necton2
parents:
diff changeset
212
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
213 def dbus_config_get(self, section, name):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
214 return self._callback("config_get", section, name)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
215
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
216 def dbus_connect(self, profile_key="@DEFAULT@", password='', options={}):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
217 return self._callback("connect", profile_key, password, options)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
218
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
219 def dbus_contact_add(self, entity_jid, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
220 return self._callback("contact_add", entity_jid, profile_key)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
221
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
222 def dbus_contact_del(self, entity_jid, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
223 return self._callback("contact_del", entity_jid, profile_key)
1622
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1599
diff changeset
224
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
225 def dbus_contact_get(self, arg_0, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
226 return self._callback("contact_get", arg_0, profile_key)
893
308a96bc7c1b core, frontends: add method asyncDeleteProfile, remove synchronous methods createProfile and deleteProfile
souliane <souliane@mailoo.org>
parents: 811
diff changeset
227
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
228 def dbus_contact_update(self, entity_jid, name, groups, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
229 return self._callback("contact_update", entity_jid, name, groups, profile_key)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
230
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
231 def dbus_contacts_get(self, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
232 return self._callback("contacts_get", profile_key)
2142
be96beb7ca14 core, bridge, frontends: renamed asyncConnect to connect, and added options parameters (not used yet)
Goffi <goffi@goffi.org>
parents: 2126
diff changeset
233
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
234 def dbus_contacts_get_from_group(self, group, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
235 return self._callback("contacts_get_from_group", group, profile_key)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
236
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
237 def dbus_devices_infos_get(self, bare_jid, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
238 return self._callback("devices_infos_get", bare_jid, profile_key)
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
239
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
240 def dbus_disco_find_by_features(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
241 return self._callback("disco_find_by_features", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key)
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
242
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
243 def dbus_disco_infos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
244 return self._callback("disco_infos", entity_jid, node, use_cache, profile_key)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
245
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
246 def dbus_disco_items(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
247 return self._callback("disco_items", entity_jid, node, use_cache, profile_key)
963
723f28cd15c7 core (disco): added discoInfos and discoItems bridge methods
Goffi <goffi@goffi.org>
parents: 943
diff changeset
248
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
249 def dbus_disconnect(self, profile_key="@DEFAULT@"):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
250 return self._callback("disconnect", profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
251
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
252 def dbus_encryption_namespace_get(self, arg_0):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
253 return self._callback("encryption_namespace_get", arg_0)
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
254
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
255 def dbus_encryption_plugins_get(self, ):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
256 return self._callback("encryption_plugins_get", )
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2655
diff changeset
257
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
258 def dbus_encryption_trust_ui_get(self, to_jid, namespace, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
259 return self._callback("encryption_trust_ui_get", to_jid, namespace, profile_key)
2733
e347e32aa07f core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods:
Goffi <goffi@goffi.org>
parents: 2658
diff changeset
260
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
261 def dbus_entities_data_get(self, jids, keys, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
262 return self._callback("entities_data_get", jids, keys, profile)
364
312ca6f9d84a core: configuration file
Goffi <goffi@goffi.org>
parents: 360
diff changeset
263
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
264 def dbus_entity_data_get(self, jid, keys, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
265 return self._callback("entity_data_get", jid, keys, profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
266
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
267 def dbus_features_get(self, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
268 return self._callback("features_get", profile_key)
501
e9634d2e7b38 core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
Goffi <goffi@goffi.org>
parents: 480
diff changeset
269
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
270 def dbus_history_get(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
271 return self._callback("history_get", from_jid, to_jid, limit, between, filters, profile)
1314
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
272
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
273 def dbus_image_check(self, arg_0):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
274 return self._callback("image_check", arg_0)
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
275
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
276 def dbus_image_convert(self, source, dest, arg_2, extra):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
277 return self._callback("image_convert", source, dest, arg_2, extra)
1482
80cd55dd5b04 core, bridge: added getFeatures method:
Goffi <goffi@goffi.org>
parents: 1467
diff changeset
278
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
279 def dbus_image_generate_preview(self, image_path, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
280 return self._callback("image_generate_preview", image_path, profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
281
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
282 def dbus_image_resize(self, image_path, width, height):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
283 return self._callback("image_resize", image_path, width, height)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
284
4193
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4148
diff changeset
285 def dbus_init_pre_script(self, ):
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4148
diff changeset
286 return self._callback("init_pre_script", )
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4148
diff changeset
287
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
288 def dbus_is_connected(self, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
289 return self._callback("is_connected", profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
290
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
291 def dbus_main_resource_get(self, contact_jid, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
292 return self._callback("main_resource_get", contact_jid, profile_key)
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
293
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
294 def dbus_menu_help_get(self, menu_id, language):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
295 return self._callback("menu_help_get", menu_id, language)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
296
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
297 def dbus_menu_launch(self, menu_type, path, data, security_limit, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
298 return self._callback("menu_launch", menu_type, path, data, security_limit, profile_key)
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
299
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
300 def dbus_menus_get(self, language, security_limit):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
301 return self._callback("menus_get", language, security_limit)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
302
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
303 def dbus_message_encryption_get(self, to_jid, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
304 return self._callback("message_encryption_get", to_jid, profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
305
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
306 def dbus_message_encryption_start(self, to_jid, namespace='', replace=False, profile_key="@NONE@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
307 return self._callback("message_encryption_start", to_jid, namespace, replace, profile_key)
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
diff changeset
308
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
309 def dbus_message_encryption_stop(self, to_jid, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
310 return self._callback("message_encryption_stop", to_jid, profile_key)
3066
2cc2f65379f7 core: added imageCheck and imageResize methods:
Goffi <goffi@goffi.org>
parents: 3028
diff changeset
311
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
312 def dbus_message_send(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
313 return self._callback("message_send", to_jid, message, subject, mess_type, extra, profile_key)
3259
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
314
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
315 def dbus_namespaces_get(self, ):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
316 return self._callback("namespaces_get", )
3201
439e2f88c3a9 core, bridge: new `imageGeneratePreview` helped method to generate a thumbnail
Goffi <goffi@goffi.org>
parents: 3179
diff changeset
317
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
318 def dbus_notification_add(self, type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
319 return self._callback("notification_add", type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
320
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
321 def dbus_notification_delete(self, id_, is_global, profile_key):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
322 return self._callback("notification_delete", id_, is_global, profile_key)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
323
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
324 def dbus_notifications_expired_clean(self, limit_timestamp, profile_key):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
325 return self._callback("notifications_expired_clean", limit_timestamp, profile_key)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
326
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
327 def dbus_notifications_get(self, filters, profile_key):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
328 return self._callback("notifications_get", filters, profile_key)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
329
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
330 def dbus_param_get_a(self, name, category, attribute="value", profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
331 return self._callback("param_get_a", name, category, attribute, profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
332
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
333 def dbus_param_get_a_async(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
334 return self._callback("param_get_a_async", name, category, attribute, security_limit, profile_key)
60
9764e027ecc0 SàT: multi-profile parameters, first draft
Goffi <goffi@goffi.org>
parents: 57
diff changeset
335
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
336 def dbus_param_set(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
337 return self._callback("param_set", name, value, category, security_limit, profile_key)
1015
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
338
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
339 def dbus_param_ui_get(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
340 return self._callback("param_ui_get", security_limit, app, extra, profile_key)
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
341
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
342 def dbus_params_categories_get(self, ):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
343 return self._callback("params_categories_get", )
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
344
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
345 def dbus_params_register_app(self, xml, security_limit=-1, app=''):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
346 return self._callback("params_register_app", xml, security_limit, app)
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
347
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
348 def dbus_params_template_load(self, filename):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
349 return self._callback("params_template_load", filename)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2655
diff changeset
350
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
351 def dbus_params_template_save(self, filename):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
352 return self._callback("params_template_save", filename)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2655
diff changeset
353
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
354 def dbus_params_values_from_category_get_async(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
355 return self._callback("params_values_from_category_get_async", category, security_limit, app, extra, profile_key)
2646
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
356
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
357 def dbus_presence_set(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
358 return self._callback("presence_set", to_jid, show, statuses, profile_key)
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
359
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
360 def dbus_presence_statuses_get(self, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
361 return self._callback("presence_statuses_get", profile_key)
2443
81a45e7886c9 core: added a mechanism to associate short names to namespaces:
Goffi <goffi@goffi.org>
parents: 2414
diff changeset
362
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
363 def dbus_private_data_delete(self, namespace, key, arg_2):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
364 return self._callback("private_data_delete", namespace, key, arg_2)
777
5642939d254e core, bridge: new method paramsRegisterApp to register frontend's specific parameters
souliane <souliane@mailoo.org>
parents: 773
diff changeset
365
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
366 def dbus_private_data_get(self, namespace, key, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
367 return self._callback("private_data_get", namespace, key, profile_key)
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
368
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
369 def dbus_private_data_set(self, namespace, key, data, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
370 return self._callback("private_data_set", namespace, key, data, profile_key)
3163
d10b2368684e bridge: added methods to let frontends store/retrieve/delete private data
Goffi <goffi@goffi.org>
parents: 3143
diff changeset
371
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
372 def dbus_profile_create(self, profile, password='', component=''):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
373 return self._callback("profile_create", profile, password, component)
2144
1d3f73e065e1 core, jp: component handling + client handling refactoring:
Goffi <goffi@goffi.org>
parents: 2142
diff changeset
374
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
375 def dbus_profile_delete_async(self, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
376 return self._callback("profile_delete_async", profile)
1592
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
377
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
378 def dbus_profile_is_session_started(self, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
379 return self._callback("profile_is_session_started", profile_key)
2168
255830fdb80b core, bridge: renamed getProfileName to profileNameGet according to new conventions
Goffi <goffi@goffi.org>
parents: 2150
diff changeset
380
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
381 def dbus_profile_name_get(self, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
382 return self._callback("profile_name_get", profile_key)
1595
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
383
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
384 def dbus_profile_set_default(self, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
385 return self._callback("profile_set_default", profile)
1592
d6d655238a93 bridge: new core method profileStartSession to start a session without connecting the profile
Goffi <goffi@goffi.org>
parents: 1587
diff changeset
386
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
387 def dbus_profile_start_session(self, password='', profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
388 return self._callback("profile_start_session", password, profile_key)
2146
1bb9bf1b4150 core, frontends: getProfilesList renamed to profilesGetList + behaviour change:
Goffi <goffi@goffi.org>
parents: 2144
diff changeset
389
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
390 def dbus_profiles_list_get(self, clients=True, components=False):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
391 return self._callback("profiles_list_get", clients, components)
1626
63cef4dbf2a4 core, plugins file, XEP-0234, bridge: progression api enhancement:
Goffi <goffi@goffi.org>
parents: 1622
diff changeset
392
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
393 def dbus_progress_get(self, id, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
394 return self._callback("progress_get", id, profile)
2113
9c861d07b5b6 core: added sessionGetInfos bridge method to retrieve various data on current profile session + client.started keep start time
Goffi <goffi@goffi.org>
parents: 2086
diff changeset
395
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
396 def dbus_progress_get_all(self, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
397 return self._callback("progress_get_all", profile)
2628
779351da2c13 core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
Goffi <goffi@goffi.org>
parents: 2624
diff changeset
398
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
399 def dbus_progress_get_all_metadata(self, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
400 return self._callback("progress_get_all_metadata", profile)
345
e6047415868d Bridge: added updateContact method
Goffi <goffi@goffi.org>
parents: 337
diff changeset
401
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
402 def dbus_ready_get(self, ):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
403 return self._callback("ready_get", )
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
404
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
405 def dbus_roster_resync(self, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
406 return self._callback("roster_resync", profile_key)
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
407
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
408 def dbus_session_infos_get(self, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
409 return self._callback("session_infos_get", profile_key)
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
410
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
411 def dbus_sub_waiting_get(self, profile_key="@DEFAULT@"):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
412 return self._callback("sub_waiting_get", profile_key)
468
c97640c90a94 D-Bus Bridge: use inspection to name attribute + fix asynchronous calls for dynamically added method, it now use deferred return value instead of callback/errback attributes
Goffi <goffi@goffi.org>
parents: 459
diff changeset
413
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
414 def dbus_subscription(self, sub_type, entity, profile_key="@DEFAULT@"):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
415 return self._callback("subscription", sub_type, entity, profile_key)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
416
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
417 def dbus_version_get(self, ):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
418 return self._callback("version_get", )
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
419
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
420
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
421 class bridge:
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
422
0
goffi@necton2
parents:
diff changeset
423 def __init__(self):
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
424 log.info("Init DBus...")
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
425 self._obj = DBusObject(const_OBJ_PATH)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
426
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
427 async def post_init(self):
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
428 try:
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
429 conn = await client.connect(reactor)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
430 except error.DBusException as e:
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
431 if e.errName == "org.freedesktop.DBus.Error.NotSupported":
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
432 log.error(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
433 _(
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
434 "D-Bus is not launched, please see README to see instructions on "
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
435 "how to launch it"
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
436 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
437 )
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
438 raise BridgeInitError(str(e))
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
439
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
440 conn.exportObject(self._obj)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
441 await conn.requestBusName(const_INT_PREFIX)
0
goffi@necton2
parents:
diff changeset
442
2854
eb9fa72eb62b core: added a "_debug" signal:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
443 def _debug(self, action, params, profile):
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
444 self._obj.emitSignal("_debug", action, params, profile)
2854
eb9fa72eb62b core: added a "_debug" signal:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
445
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
446 def action_new(self, action_data, id, security_limit, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
447 self._obj.emitSignal("action_new", action_data, id, security_limit, profile)
1467
ceba6fd77739 core, bridge: new signal actionNew to launch an action from the backend (e.g. display a dialog message):
Goffi <goffi@goffi.org>
parents: 1435
diff changeset
448
2894
c7c52c0dc13a core, quick_frontend(app): fixed connected signal handling
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
449 def connected(self, jid_s, profile):
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
450 self._obj.emitSignal("connected", jid_s, profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
451
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
452 def contact_deleted(self, entity_jid, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
453 self._obj.emitSignal("contact_deleted", entity_jid, profile)
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
454
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
455 def contact_new(self, contact_jid, attributes, groups, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
456 self._obj.emitSignal("contact_new", contact_jid, attributes, groups, profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
457
66
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
458 def disconnected(self, profile):
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
459 self._obj.emitSignal("disconnected", profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
460
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
461 def entity_data_updated(self, jid, name, value, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
462 self._obj.emitSignal("entity_data_updated", jid, name, value, profile)
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
463
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
464 def message_encryption_started(self, to_jid, encryption_data, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
465 self._obj.emitSignal("message_encryption_started", to_jid, encryption_data, profile_key)
2655
b8600f8130ac core (bridge): new messageEncryptionStarted and messageEncryptionStopped signals (not used yet)
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
466
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
467 def message_encryption_stopped(self, to_jid, encryption_data, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
468 self._obj.emitSignal("message_encryption_stopped", to_jid, encryption_data, profile_key)
2655
b8600f8130ac core (bridge): new messageEncryptionStarted and messageEncryptionStopped signals (not used yet)
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
469
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
470 def message_new(self, uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
471 self._obj.emitSignal("message_new", uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile)
0
goffi@necton2
parents:
diff changeset
472
4148
a8a0fa678ce2 bridge: add `message_update` signal
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
473 def message_update(self, uid, message_type, message_data, profile):
a8a0fa678ce2 bridge: add `message_update` signal
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
474 self._obj.emitSignal("message_update", uid, message_type, message_data, profile)
a8a0fa678ce2 bridge: add `message_update` signal
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
475
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
476 def notification_deleted(self, id, profile):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
477 self._obj.emitSignal("notification_deleted", id, profile)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
478
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
479 def notification_new(self, id, timestamp, type, body_plain, body_rich, title, requires_action, priority, expire_at, extra, profile):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
480 self._obj.emitSignal("notification_new", id, timestamp, type, body_plain, body_rich, title, requires_action, priority, expire_at, extra, profile)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
481
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
482 def param_update(self, name, value, category, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
483 self._obj.emitSignal("param_update", name, value, category, profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
484
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
485 def presence_update(self, entity_jid, show, priority, statuses, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
486 self._obj.emitSignal("presence_update", entity_jid, show, priority, statuses, profile)
49
9c79eb49d51f DBus bridge improvment:
Goffi <goffi@goffi.org>
parents: 37
diff changeset
487
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
488 def progress_error(self, id, error, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
489 self._obj.emitSignal("progress_error", id, error, profile)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
490
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
491 def progress_finished(self, id, metadata, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
492 self._obj.emitSignal("progress_finished", id, metadata, profile)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
493
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
494 def progress_started(self, id, metadata, profile):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
495 self._obj.emitSignal("progress_started", id, metadata, profile)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
496
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
497 def subscribe(self, sub_type, entity_jid, profile):
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
498 self._obj.emitSignal("subscribe", sub_type, entity_jid, profile)
0
goffi@necton2
parents:
diff changeset
499
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
500 def register_method(self, name, callback):
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
501 log.debug(f"registering DBus bridge method [{name}]")
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
502 self._obj.register_method(name, callback)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
503
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
504 def emit_signal(self, name, *args):
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
505 self._obj.emitSignal(name, *args)
0
goffi@necton2
parents:
diff changeset
506
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
507 def add_method(
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
508 self, name, int_suffix, in_sign, out_sign, method, async_=False, doc={}
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
509 ):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
510 """Dynamically add a method to D-Bus bridge"""
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
511 # FIXME: doc parameter is kept only temporary, the time to remove it from calls
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
512 log.debug(f"Adding method {name!r} to D-Bus bridge")
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
513 self._obj.plugin_iface.addMethod(
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
514 Method(name, arguments=in_sign, returns=out_sign)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
515 )
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
516 # we have to create a method here instead of using partialmethod, because txdbus
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
517 # uses __func__ which doesn't work with partialmethod
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
518 def caller(self_, *args, **kwargs):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
519 return self_._callback(name, *args, **kwargs)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
520 setattr(self._obj, f"dbus_{name}", MethodType(caller, self._obj))
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
521 self.register_method(name, method)
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
522
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
523 def add_signal(self, name, int_suffix, signature, doc={}):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
524 """Dynamically add a signal to D-Bus bridge"""
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
525 log.debug(f"Adding signal {name!r} to D-Bus bridge")
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
526 self._obj.plugin_iface.addSignal(Signal(name, signature))
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
527 setattr(bridge, name, partialmethod(bridge.emit_signal, name))