Mercurial > libervia-backend
annotate libervia/backend/bridge/dbus_bridge.py @ 4179:3b95704ab777
core: fix path in `get_local_path`:
`local_dir` was not used in final path, resulting in workind dir used instead or actual
local path.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 09 Dec 2023 14:05:02 +0100 |
parents | a8a0fa678ce2 |
children | 730f542e4ad0 |
rev | line source |
---|---|
3028 | 1 #!/usr/bin/env python3 |
3137 | 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 | 4 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org) |
0 | 5 |
609
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
6 # This program is free software: you can redistribute it and/or modify |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
7 # it under the terms of the GNU Affero General Public License as published by |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
8 # the Free Software Foundation, either version 3 of the License, or |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
9 # (at your option) any later version. |
0 | 10 |
609
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
14 # GNU Affero General Public License for more details. |
0 | 15 |
609
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
16 # You should have received a copy of the GNU Affero General Public License |
84a6e83157c2
fixed licences in docstrings (they are now in comments)
Goffi <goffi@goffi.org>
parents:
595
diff
changeset
|
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
0 | 18 |
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 | 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'), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
117 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
|
118 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
|
119 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
|
120 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
|
121 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
|
122 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
|
123 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
|
124 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
|
125 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
|
126 Method('namespaces_get', arguments='', returns='a{ss}'), |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
127 Method('notification_add', arguments='ssssbbsdss', returns=''), |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
128 Method('notification_delete', arguments='sbs', returns=''), |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
129 Method('notifications_expired_clean', arguments='ds', returns=''), |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
130 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
|
131 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
|
132 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
|
133 Method('param_set', arguments='sssis', returns=''), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
134 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
|
135 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
|
136 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
|
137 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
|
138 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
|
139 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
|
140 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
|
141 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
|
142 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
|
143 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
|
144 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
|
145 Method('profile_create', arguments='sss', returns=''), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
146 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
|
147 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
|
148 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
|
149 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
|
150 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
|
151 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
|
152 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
|
153 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
|
154 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
|
155 Method('ready_get', arguments='', returns=''), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
156 Method('roster_resync', arguments='s', returns=''), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
157 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
|
158 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
|
159 Method('subscription', arguments='sss', returns=''), |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
160 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
|
161 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
|
162 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
|
163 Signal('connected', 'ss'), |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
164 Signal('contact_deleted', 'ss'), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
165 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
|
166 Signal('disconnected', 's'), |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
167 Signal('entity_data_updated', 'ssss'), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
168 Signal('message_encryption_started', 'sss'), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
169 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
|
170 Signal('message_new', 'sdssa{ss}a{ss}sss'), |
4148
a8a0fa678ce2
bridge: add `message_update` signal
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
171 Signal('message_update', 'ssss'), |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
172 Signal('notification_deleted', 'ss'), |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
173 Signal('notification_new', 'sdssssbidss'), |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
174 Signal('param_update', 'ssss'), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
175 Signal('presence_update', 'ssia{ss}s'), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
176 Signal('progress_error', 'sss'), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
177 Signal('progress_finished', 'sa{ss}s'), |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
178 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
|
179 Signal('subscribe', 'sss'), |
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
180 ) |
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
181 plugin_iface = DBusInterface( |
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
182 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
|
183 ) |
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 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
|
186 |
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
187 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
|
188 super().__init__(path) |
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
189 log.debug("Init DBusObject...") |
595
1f160467f5de
Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
190 self.cb = {} |
0 | 191 |
2086 | 192 def register_method(self, name, cb): |
595
1f160467f5de
Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
193 self.cb[name] = cb |
0 | 194 |
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
|
195 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
|
196 """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
|
197 try: |
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
198 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
|
199 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
|
200 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
|
201 else: |
3539
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
202 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
|
203 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
|
204 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
|
205 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
206 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
|
207 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
|
208 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
209 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
|
210 return self._callback("actions_get", profile_key) |
0 | 211 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
212 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
|
213 return self._callback("config_get", section, name) |
1522
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
214 |
3539
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
215 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
|
216 return self._callback("connect", profile_key, password, options) |
1522
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
217 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
218 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
|
219 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
|
220 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
221 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
|
222 return self._callback("contact_del", entity_jid, profile_key) |
1622 | 223 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
224 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
|
225 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
|
226 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
227 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
|
228 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
|
229 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
230 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
|
231 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
|
232 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
233 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
|
234 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
|
235 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
236 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
|
237 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
|
238 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
239 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
|
240 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
|
241 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
242 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
|
243 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
|
244 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
245 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
|
246 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
|
247 |
3539
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
248 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
|
249 return self._callback("disconnect", profile_key) |
267 | 250 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
251 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
|
252 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
|
253 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
254 def dbus_encryption_plugins_get(self, ): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
255 return self._callback("encryption_plugins_get", ) |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2655
diff
changeset
|
256 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
257 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
|
258 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
|
259 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
260 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
|
261 return self._callback("entities_data_get", jids, keys, profile) |
364 | 262 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
263 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
|
264 return self._callback("entity_data_get", jid, keys, profile) |
267 | 265 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
266 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
|
267 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
|
268 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
269 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
|
270 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
|
271 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
272 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
|
273 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
|
274 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
275 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
|
276 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
|
277 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
278 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
|
279 return self._callback("image_generate_preview", image_path, profile_key) |
267 | 280 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
281 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
|
282 return self._callback("image_resize", image_path, width, height) |
267 | 283 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
284 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
|
285 return self._callback("is_connected", profile_key) |
267 | 286 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
287 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
|
288 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
|
289 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
290 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
|
291 return self._callback("menu_help_get", menu_id, language) |
267 | 292 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
293 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
|
294 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
|
295 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
296 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
|
297 return self._callback("menus_get", language, security_limit) |
267 | 298 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
299 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
|
300 return self._callback("message_encryption_get", to_jid, profile_key) |
267 | 301 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
302 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
|
303 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
|
304 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
305 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
|
306 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
|
307 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
308 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
|
309 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
|
310 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
311 def dbus_namespaces_get(self, ): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
312 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
|
313 |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
314 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
|
315 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
|
316 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
317 def dbus_notification_delete(self, id_, is_global, profile_key): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
318 return self._callback("notification_delete", id_, is_global, profile_key) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
319 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
320 def dbus_notifications_expired_clean(self, limit_timestamp, profile_key): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
321 return self._callback("notifications_expired_clean", limit_timestamp, profile_key) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
322 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
323 def dbus_notifications_get(self, filters, profile_key): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
324 return self._callback("notifications_get", filters, profile_key) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
325 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
326 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
|
327 return self._callback("param_get_a", name, category, attribute, profile_key) |
267 | 328 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
329 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
|
330 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
|
331 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
332 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
|
333 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
|
334 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
335 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
|
336 return self._callback("param_ui_get", security_limit, app, extra, profile_key) |
2126 | 337 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
338 def dbus_params_categories_get(self, ): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
339 return self._callback("params_categories_get", ) |
2126 | 340 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
341 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
|
342 return self._callback("params_register_app", xml, security_limit, app) |
2126 | 343 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
344 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
|
345 return self._callback("params_template_load", filename) |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2655
diff
changeset
|
346 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
347 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
|
348 return self._callback("params_template_save", filename) |
2658
4e130cc9bfc0
core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents:
2655
diff
changeset
|
349 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
350 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
|
351 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
|
352 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
353 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
|
354 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
|
355 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
356 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
|
357 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
|
358 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
359 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
|
360 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
|
361 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
362 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
|
363 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
|
364 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
365 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
|
366 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
|
367 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
368 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
|
369 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
|
370 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
371 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
|
372 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
|
373 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
374 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
|
375 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
|
376 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
377 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
|
378 return self._callback("profile_name_get", profile_key) |
1595
a3d0cfa5b7a6
core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents:
1592
diff
changeset
|
379 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
380 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
|
381 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
|
382 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
383 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
|
384 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
|
385 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
386 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
|
387 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
|
388 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
389 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
|
390 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
|
391 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
392 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
|
393 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
|
394 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
395 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
|
396 return self._callback("progress_get_all_metadata", profile) |
345 | 397 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
398 def dbus_ready_get(self, ): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
399 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
|
400 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
401 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
|
402 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
|
403 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
404 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
|
405 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
|
406 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
407 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
|
408 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
|
409 |
3539
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
410 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
|
411 return self._callback("subscription", sub_type, entity, profile_key) |
587
952322b1d490
Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
572
diff
changeset
|
412 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
413 def dbus_version_get(self, ): |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
414 return self._callback("version_get", ) |
595
1f160467f5de
Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
587
diff
changeset
|
415 |
7
c14a3a7018a5
added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents:
1
diff
changeset
|
416 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
417 class bridge: |
3539
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
418 |
0 | 419 def __init__(self): |
993
301b342c697a
core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents:
963
diff
changeset
|
420 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
|
421 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
|
422 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
423 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
|
424 try: |
3539
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
425 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
|
426 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
|
427 if e.errName == "org.freedesktop.DBus.Error.NotSupported": |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
428 log.error( |
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
429 _( |
3539
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
430 "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
|
431 "how to launch it" |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
432 ) |
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 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
|
435 |
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
436 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
|
437 await conn.requestBusName(const_INT_PREFIX) |
0 | 438 |
2854 | 439 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
|
440 self._obj.emitSignal("_debug", action, params, profile) |
2854 | 441 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
442 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
|
443 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
|
444 |
2894
c7c52c0dc13a
core, quick_frontend(app): fixed connected signal handling
Goffi <goffi@goffi.org>
parents:
2892
diff
changeset
|
445 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
|
446 self._obj.emitSignal("connected", jid_s, profile) |
267 | 447 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
448 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
|
449 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
|
450 |
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
451 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
|
452 self._obj.emitSignal("contact_new", contact_jid, attributes, groups, profile) |
267 | 453 |
66
8147b4f40809
SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents:
65
diff
changeset
|
454 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
|
455 self._obj.emitSignal("disconnected", profile) |
267 | 456 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
457 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
|
458 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
|
459 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
460 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
|
461 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
|
462 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
463 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
|
464 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
|
465 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
466 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
|
467 self._obj.emitSignal("message_new", uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile) |
0 | 468 |
4148
a8a0fa678ce2
bridge: add `message_update` signal
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
469 def message_update(self, uid, message_type, message_data, profile): |
a8a0fa678ce2
bridge: add `message_update` signal
Goffi <goffi@goffi.org>
parents:
4130
diff
changeset
|
470 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
|
471 |
4130
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
472 def notification_deleted(self, id, profile): |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
473 self._obj.emitSignal("notification_deleted", id, profile) |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
474 |
02f0adc745c6
core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents:
4071
diff
changeset
|
475 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
|
476 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
|
477 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
478 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
|
479 self._obj.emitSignal("param_update", name, value, category, profile) |
267 | 480 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
481 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
|
482 self._obj.emitSignal("presence_update", entity_jid, show, priority, statuses, profile) |
49 | 483 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
484 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
|
485 self._obj.emitSignal("progress_error", id, error, profile) |
1522
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
486 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
487 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
|
488 self._obj.emitSignal("progress_finished", id, metadata, profile) |
1522
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
489 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
490 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
|
491 self._obj.emitSignal("progress_started", id, metadata, profile) |
1522
7d7e57a84792
core: progression handling improvments:
Goffi <goffi@goffi.org>
parents:
1482
diff
changeset
|
492 |
387
e66d300c5d42
frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents:
371
diff
changeset
|
493 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
|
494 self._obj.emitSignal("subscribe", sub_type, entity_jid, profile) |
0 | 495 |
2086 | 496 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
|
497 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
|
498 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
|
499 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
500 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
|
501 self._obj.emitSignal(name, *args) |
0 | 502 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
503 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
|
504 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
|
505 ): |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
506 """Dynamically add a method to D-Bus bridge""" |
2624
56f94936df1e
code style reformatting using black
Goffi <goffi@goffi.org>
parents:
2595
diff
changeset
|
507 # 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
|
508 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
|
509 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
|
510 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
|
511 ) |
60d3861e5996
bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents:
3480
diff
changeset
|
512 # 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
|
513 # 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
|
514 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
|
515 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
|
516 setattr(self._obj, f"dbus_{name}", MethodType(caller, self._obj)) |
2086 | 517 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
|
518 |
4037
524856bd7b19
massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents:
3539
diff
changeset
|
519 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
|
520 """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
|
521 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
|
522 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
|
523 setattr(bridge, name, partialmethod(bridge.emit_signal, name)) |