annotate libervia/backend/bridge/dbus_bridge.py @ 4318:27bb22eace65

tests (unit/email gateway): add test for XEP-0131 handling: rel 451
author Goffi <goffi@goffi.org>
date Sat, 28 Sep 2024 15:59:48 +0200
parents 3a550e9a2b55
children
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(
4270
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
34 config.parse_main_conf(), "", "bridge_dbus_int_prefix", "org.libervia.Libervia"
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
35 )
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
36 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
37 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
38 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
39 const_PLUGIN_SUFFIX = ".plugin"
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
40
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
41
477
031b0e0aaab8 plugin groupblog: subscriptions/notifications
Goffi <goffi@goffi.org>
parents: 469
diff changeset
42 class ParseError(Exception):
031b0e0aaab8 plugin groupblog: subscriptions/notifications
Goffi <goffi@goffi.org>
parents: 469
diff changeset
43 pass
031b0e0aaab8 plugin groupblog: subscriptions/notifications
Goffi <goffi@goffi.org>
parents: 469
diff changeset
44
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
45
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
46 class DBusException(Exception):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
47 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
48
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
49
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
50 class MethodNotRegistered(DBusException):
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
51 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
52
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
53
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
54 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
55 def __init__(self, twisted_error):
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
56 """
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
57
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
58 @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
59 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
60 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
61 """
751
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
62 try:
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
63 # 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
64 class_ = twisted_error.value().__class__
751
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
65 except TypeError:
1def5b7edf9f core, bridge: better GenericException handling
Goffi <goffi@goffi.org>
parents: 698
diff changeset
66 # 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
67 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
68 data = twisted_error.getErrorMessage()
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
69 try:
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
70 data = (data, twisted_error.value.condition)
1073
f094583732de bridge: DBusException also transports the twisted failure condition
souliane <souliane@mailoo.org>
parents: 1062
diff changeset
71 except AttributeError:
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,)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
73 else:
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
74 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
75 self.dbusErrorName = ".".join(
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
76 (const_ERROR_PREFIX, class_.__module__, class_.__name__)
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
77 )
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
78 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
79
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
80 @classmethod
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
81 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
82 raise cls(exc)
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
83
419
6c167a2e04b8 bridge: added generic D-Bus exception management + asyncCreateProfile method
Goffi <goffi@goffi.org>
parents: 413
diff changeset
84
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
85 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
86
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
87 core_iface = DBusInterface(
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
88 const_INT_PREFIX + const_CORE_SUFFIX,
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
89 Method("action_launch", arguments="sss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
90 Method("actions_get", arguments="s", returns="a(ssi)"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
91 Method("config_get", arguments="ss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
92 Method("connect", arguments="ssa{ss}", returns="b"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
93 Method("contact_add", arguments="ss", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
94 Method("contact_del", arguments="ss", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
95 Method("contact_get", arguments="ss", returns="(a{ss}as)"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
96 Method("contact_update", arguments="ssass", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
97 Method("contacts_get", arguments="s", returns="a(sa{ss}as)"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
98 Method("contacts_get_from_group", arguments="ss", returns="as"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
99 Method("devices_infos_get", arguments="ss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
100 Method(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
101 "disco_find_by_features",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
102 arguments="asa(ss)bbbbbs",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
103 returns="(a{sa(sss)}a{sa(sss)}a{sa(sss)})",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
104 ),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
105 Method("disco_infos", arguments="ssbs", returns="(asa(sss)a{sa(a{ss}as)})"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
106 Method("disco_items", arguments="ssbs", returns="a(sss)"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
107 Method("disconnect", arguments="s", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
108 Method("encryption_namespace_get", arguments="s", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
109 Method("encryption_plugins_get", arguments="", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
110 Method("encryption_trust_ui_get", arguments="sss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
111 Method("entities_data_get", arguments="asass", returns="a{sa{ss}}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
112 Method("entity_data_get", arguments="sass", returns="a{ss}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
113 Method("features_get", arguments="s", returns="a{sa{ss}}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
114 Method("history_get", arguments="ssiba{ss}s", returns="a(sdssa{ss}a{ss}ss)"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
115 Method("image_check", arguments="s", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
116 Method("image_convert", arguments="ssss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
117 Method("image_generate_preview", arguments="ss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
118 Method("image_resize", arguments="sii", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
119 Method("init_pre_script", arguments="", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
120 Method("is_connected", arguments="s", returns="b"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
121 Method("main_resource_get", arguments="ss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
122 Method("menu_help_get", arguments="ss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
123 Method("menu_launch", arguments="sasa{ss}is", returns="a{ss}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
124 Method("menus_get", arguments="si", returns="a(ssasasa{ss})"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
125 Method("message_encryption_get", arguments="ss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
126 Method("message_encryption_start", arguments="ssbs", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
127 Method("message_encryption_stop", arguments="ss", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
128 Method("message_send", arguments="sa{ss}a{ss}sss", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
129 Method("namespaces_get", arguments="", returns="a{ss}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
130 Method("notification_add", arguments="ssssbbsdss", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
131 Method("notification_delete", arguments="sbs", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
132 Method("notifications_expired_clean", arguments="ds", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
133 Method("notifications_get", arguments="ss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
134 Method("param_get_a", arguments="ssss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
135 Method("param_get_a_async", arguments="sssis", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
136 Method("param_set", arguments="sssis", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
137 Method("param_ui_get", arguments="isss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
138 Method("params_categories_get", arguments="", returns="as"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
139 Method("params_register_app", arguments="sis", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
140 Method("params_template_load", arguments="s", returns="b"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
141 Method("params_template_save", arguments="s", returns="b"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
142 Method(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
143 "params_values_from_category_get_async", arguments="sisss", returns="a{ss}"
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
144 ),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
145 Method("presence_set", arguments="ssa{ss}s", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
146 Method("presence_statuses_get", arguments="s", returns="a{sa{s(sia{ss})}}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
147 Method("private_data_delete", arguments="sss", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
148 Method("private_data_get", arguments="sss", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
149 Method("private_data_set", arguments="ssss", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
150 Method("profile_create", arguments="sss", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
151 Method("profile_delete_async", arguments="s", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
152 Method("profile_is_session_started", arguments="s", returns="b"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
153 Method("profile_name_get", arguments="s", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
154 Method("profile_set_default", arguments="s", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
155 Method("profile_start_session", arguments="ss", returns="b"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
156 Method("profiles_list_get", arguments="bb", returns="as"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
157 Method("progress_get", arguments="ss", returns="a{ss}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
158 Method("progress_get_all", arguments="s", returns="a{sa{sa{ss}}}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
159 Method("progress_get_all_metadata", arguments="s", returns="a{sa{sa{ss}}}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
160 Method("ready_get", arguments="", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
161 Method("roster_resync", arguments="s", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
162 Method("session_infos_get", arguments="s", returns="a{ss}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
163 Method("sub_waiting_get", arguments="s", returns="a{ss}"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
164 Method("subscription", arguments="sss", returns=""),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
165 Method("version_get", arguments="", returns="s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
166 Signal("_debug", "sa{ss}s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
167 Signal("action_new", "ssis"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
168 Signal("connected", "ss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
169 Signal("contact_deleted", "ss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
170 Signal("contact_new", "sa{ss}ass"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
171 Signal("disconnected", "s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
172 Signal("entity_data_updated", "ssss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
173 Signal("message_encryption_started", "sss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
174 Signal("message_encryption_stopped", "sa{ss}s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
175 Signal("message_new", "sdssa{ss}a{ss}sss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
176 Signal("message_update", "ssss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
177 Signal("notification_deleted", "ss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
178 Signal("notification_new", "sdssssbidss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
179 Signal("param_update", "ssss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
180 Signal("presence_update", "ssia{ss}s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
181 Signal("progress_error", "sss"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
182 Signal("progress_finished", "sa{ss}s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
183 Signal("progress_started", "sa{ss}s"),
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
184 Signal("subscribe", "sss"),
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
185 )
4270
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
186 plugin_iface = DBusInterface(const_INT_PREFIX + const_PLUGIN_SUFFIX)
3539
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 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
189
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
190 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
191 super().__init__(path)
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
192 log.debug("Init DBusObject...")
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
193 self.cb = {}
0
goffi@necton2
parents:
diff changeset
194
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
195 def register_method(self, name, cb):
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
196 self.cb[name] = cb
0
goffi@necton2
parents:
diff changeset
197
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
198 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
199 """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
200 try:
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
201 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
202 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
203 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
204 else:
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
205 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
206 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
207 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
208
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
209 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
210 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
211
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
212 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
213 return self._callback("actions_get", profile_key)
0
goffi@necton2
parents:
diff changeset
214
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
215 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
216 return self._callback("config_get", section, name)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
217
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
218 def dbus_connect(self, profile_key="@DEFAULT@", password="", options={}):
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
219 return self._callback("connect", profile_key, password, options)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
220
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
221 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
222 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
223
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
224 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
225 return self._callback("contact_del", entity_jid, profile_key)
1622
5b24d6bf5d15 core, bridge: actionsGet:
Goffi <goffi@goffi.org>
parents: 1599
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_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
228 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
229
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
230 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
231 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
232
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
233 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
234 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
235
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
236 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
237 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
238
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
239 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
240 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
241
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
242 def dbus_disco_find_by_features(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
243 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
244 namespaces,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
245 identities,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
246 bare_jid=False,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
247 service=True,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
248 roster=True,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
249 own_jid=True,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
250 local_device=False,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
251 profile_key="@DEFAULT@",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
252 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
253 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
254 "disco_find_by_features",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
255 namespaces,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
256 identities,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
257 bare_jid,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
258 service,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
259 roster,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
260 own_jid,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
261 local_device,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
262 profile_key,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
263 )
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
264
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
265 def dbus_disco_infos(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
266 self, entity_jid, node="", use_cache=True, profile_key="@DEFAULT@"
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
267 ):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
268 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
269
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
270 def dbus_disco_items(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
271 self, entity_jid, node="", use_cache=True, profile_key="@DEFAULT@"
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
272 ):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
273 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
274
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
275 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
276 return self._callback("disconnect", profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
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_encryption_namespace_get(self, arg_0):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
279 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
280
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
281 def dbus_encryption_plugins_get(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
282 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
283 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
284 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
285 "encryption_plugins_get",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
286 )
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2655
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_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
289 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
290
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
291 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
292 return self._callback("entities_data_get", jids, keys, profile)
364
312ca6f9d84a core: configuration file
Goffi <goffi@goffi.org>
parents: 360
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_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
295 return self._callback("entity_data_get", jid, keys, profile)
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_features_get(self, profile_key):
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
298 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
299
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
300 def dbus_history_get(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
301 self, from_jid, to_jid, limit, between=True, filters="", profile="@NONE@"
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
302 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
303 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
304 "history_get", from_jid, to_jid, limit, between, filters, profile
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
305 )
1314
bb9c32249778 core: added getEntitiesData which get cache data for several entities at once
Goffi <goffi@goffi.org>
parents: 1290
diff changeset
306
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
307 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
308 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
309
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
310 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
311 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
312
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
313 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
314 return self._callback("image_generate_preview", image_path, profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
315
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
316 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
317 return self._callback("image_resize", image_path, width, height)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
318
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
319 def dbus_init_pre_script(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
320 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
321 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
322 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
323 "init_pre_script",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
324 )
4193
730f542e4ad0 core: add new `init_script_path` option:
Goffi <goffi@goffi.org>
parents: 4148
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_is_connected(self, 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("is_connected", profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
328
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
329 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
330 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
331
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
332 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
333 return self._callback("menu_help_get", menu_id, language)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
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_menu_launch(self, menu_type, path, data, security_limit, profile_key):
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
336 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
337 "menu_launch", menu_type, path, data, security_limit, profile_key
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
338 )
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
339
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
340 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
341 return self._callback("menus_get", language, security_limit)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
342
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
343 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
344 return self._callback("message_encryption_get", to_jid, profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
345
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
346 def dbus_message_encryption_start(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
347 self, to_jid, namespace="", replace=False, profile_key="@NONE@"
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
348 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
349 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
350 "message_encryption_start", to_jid, namespace, replace, profile_key
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
351 )
1955
633b5c21aefd backend, frontend: messages refactoring (huge commit, not finished):
Goffi <goffi@goffi.org>
parents: 1934
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_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
354 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
355
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
356 def dbus_message_send(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
357 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
358 to_jid,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
359 message,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
360 subject={},
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
361 mess_type="auto",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
362 extra={},
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
363 profile_key="@NONE@",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
364 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
365 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
366 "message_send", to_jid, message, subject, mess_type, extra, profile_key
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
367 )
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
368
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
369 def dbus_namespaces_get(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
370 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
371 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
372 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
373 "namespaces_get",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
374 )
3259
f300d78f08f3 core: image convertion + SVG support:
Goffi <goffi@goffi.org>
parents: 3254
diff changeset
375
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
376 def dbus_notification_add(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
377 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
378 type_,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
379 body_plain,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
380 body_rich,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
381 title,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
382 is_global,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
383 requires_action,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
384 arg_6,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
385 priority,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
386 expire_at,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
387 extra,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
388 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
389 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
390 "notification_add",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
391 type_,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
392 body_plain,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
393 body_rich,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
394 title,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
395 is_global,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
396 requires_action,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
397 arg_6,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
398 priority,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
399 expire_at,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
400 extra,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
401 )
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
402
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
403 def dbus_notification_delete(self, id_, is_global, profile_key):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
404 return self._callback("notification_delete", id_, is_global, profile_key)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
405
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
406 def dbus_notifications_expired_clean(self, limit_timestamp, profile_key):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
407 return self._callback("notifications_expired_clean", limit_timestamp, profile_key)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
408
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
409 def dbus_notifications_get(self, filters, profile_key):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
410 return self._callback("notifications_get", filters, profile_key)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
411
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
412 def dbus_param_get_a(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
413 self, name, category, attribute="value", profile_key="@DEFAULT@"
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
414 ):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
415 return self._callback("param_get_a", name, category, attribute, profile_key)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
416
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
417 def dbus_param_get_a_async(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
418 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
419 name,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
420 category,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
421 attribute="value",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
422 security_limit=-1,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
423 profile_key="@DEFAULT@",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
424 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
425 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
426 "param_get_a_async", name, category, attribute, security_limit, profile_key
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
427 )
60
9764e027ecc0 SàT: multi-profile parameters, first draft
Goffi <goffi@goffi.org>
parents: 57
diff changeset
428
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
429 def dbus_param_set(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
430 self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
431 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
432 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
433 "param_set", name, value, category, security_limit, profile_key
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
434 )
1015
fee00f2e11c2 memory, jp: added jp commands to load/save parameters template
souliane <souliane@mailoo.org>
parents: 993
diff changeset
435
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
436 def dbus_param_ui_get(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
437 self, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
438 ):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
439 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
440
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
441 def dbus_params_categories_get(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
442 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
443 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
444 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
445 "params_categories_get",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
446 )
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
447
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
448 def dbus_params_register_app(self, xml, security_limit=-1, app=""):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
449 return self._callback("params_register_app", xml, security_limit, app)
2126
2f264f3df280 core (menus): improvments:
Goffi <goffi@goffi.org>
parents: 2113
diff changeset
450
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
451 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
452 return self._callback("params_template_load", filename)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2655
diff changeset
453
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
454 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
455 return self._callback("params_template_save", filename)
2658
4e130cc9bfc0 core (memore/encryption): new methods and checks:
Goffi <goffi@goffi.org>
parents: 2655
diff changeset
456
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
457 def dbus_params_values_from_category_get_async(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
458 self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
459 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
460 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
461 "params_values_from_category_get_async",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
462 category,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
463 security_limit,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
464 app,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
465 extra,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
466 profile_key,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
467 )
2646
712cb4ff3e13 core: new EncryptionHandler class which manage encrypted session as a core feature:
Goffi <goffi@goffi.org>
parents: 2628
diff changeset
468
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
469 def dbus_presence_set(self, to_jid="", show="", statuses={}, profile_key="@DEFAULT@"):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
470 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
471
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
472 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
473 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
474
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
475 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
476 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
477
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
478 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
479 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
480
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
481 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
482 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
483
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
484 def dbus_profile_create(self, profile, password="", component=""):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
485 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
486
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
487 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
488 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
489
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
490 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
491 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
492
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
493 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
494 return self._callback("profile_name_get", profile_key)
1595
a3d0cfa5b7a6 core, bridge: added a profileSetDefault method
Goffi <goffi@goffi.org>
parents: 1592
diff changeset
495
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
496 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
497 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
498
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
499 def dbus_profile_start_session(self, password="", profile_key="@DEFAULT@"):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
500 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
501
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
502 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
503 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
504
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
505 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
506 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
507
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
508 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
509 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
510
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
511 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
512 return self._callback("progress_get_all_metadata", profile)
345
e6047415868d Bridge: added updateContact method
Goffi <goffi@goffi.org>
parents: 337
diff changeset
513
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
514 def dbus_ready_get(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
515 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
516 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
517 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
518 "ready_get",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
519 )
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
520
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
521 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
522 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
523
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
524 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
525 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
526
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
527 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
528 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
529
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
530 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
531 return self._callback("subscription", sub_type, entity, profile_key)
587
952322b1d490 Remove trailing whitespaces.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 572
diff changeset
532
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
533 def dbus_version_get(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
534 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
535 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
536 return self._callback(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
537 "version_get",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
538 )
595
1f160467f5de Fix pep8 support in src/bridge.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 587
diff changeset
539
7
c14a3a7018a5 added dynamic exportation of Dbus bridge method (usefull for plugins)
Goffi <goffi@goffi.org>
parents: 1
diff changeset
540
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
541 class bridge:
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
542
0
goffi@necton2
parents:
diff changeset
543 def __init__(self):
993
301b342c697a core: use of the new core.log module:
Goffi <goffi@goffi.org>
parents: 963
diff changeset
544 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
545 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
546
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
547 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
548 try:
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
549 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
550 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
551 if e.errName == "org.freedesktop.DBus.Error.NotSupported":
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
552 log.error(
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
553 _(
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
554 "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
555 "how to launch it"
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
556 )
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
557 )
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
558 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
559
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
560 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
561 await conn.requestBusName(const_INT_PREFIX)
0
goffi@necton2
parents:
diff changeset
562
2854
eb9fa72eb62b core: added a "_debug" signal:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
563 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
564 self._obj.emitSignal("_debug", action, params, profile)
2854
eb9fa72eb62b core: added a "_debug" signal:
Goffi <goffi@goffi.org>
parents: 2771
diff changeset
565
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
566 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
567 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
568
2894
c7c52c0dc13a core, quick_frontend(app): fixed connected signal handling
Goffi <goffi@goffi.org>
parents: 2892
diff changeset
569 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
570 self._obj.emitSignal("connected", jid_s, profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
571
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
572 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
573 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
574
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
575 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
576 self._obj.emitSignal("contact_new", contact_jid, attributes, groups, profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
577
66
8147b4f40809 SàT: multi-profile: DBus signals and frontend adaptation (first draft)
Goffi <goffi@goffi.org>
parents: 65
diff changeset
578 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
579 self._obj.emitSignal("disconnected", profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
580
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
581 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
582 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
583
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
584 def message_encryption_started(self, to_jid, encryption_data, profile_key):
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
585 self._obj.emitSignal(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
586 "message_encryption_started", to_jid, encryption_data, profile_key
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
587 )
2655
b8600f8130ac core (bridge): new messageEncryptionStarted and messageEncryptionStopped signals (not used yet)
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
588
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
589 def message_encryption_stopped(self, to_jid, encryption_data, profile_key):
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
590 self._obj.emitSignal(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
591 "message_encryption_stopped", to_jid, encryption_data, profile_key
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
592 )
2655
b8600f8130ac core (bridge): new messageEncryptionStarted and messageEncryptionStopped signals (not used yet)
Goffi <goffi@goffi.org>
parents: 2646
diff changeset
593
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
594 def message_new(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
595 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
596 uid,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
597 timestamp,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
598 from_jid,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
599 to_jid,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
600 message,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
601 subject,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
602 mess_type,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
603 extra,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
604 profile,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
605 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
606 self._obj.emitSignal(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
607 "message_new",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
608 uid,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
609 timestamp,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
610 from_jid,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
611 to_jid,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
612 message,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
613 subject,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
614 mess_type,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
615 extra,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
616 profile,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
617 )
0
goffi@necton2
parents:
diff changeset
618
4148
a8a0fa678ce2 bridge: add `message_update` signal
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
619 def message_update(self, uid, message_type, message_data, profile):
a8a0fa678ce2 bridge: add `message_update` signal
Goffi <goffi@goffi.org>
parents: 4130
diff changeset
620 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
621
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
622 def notification_deleted(self, id, profile):
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
623 self._obj.emitSignal("notification_deleted", id, profile)
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
624
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
625 def notification_new(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
626 self,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
627 id,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
628 timestamp,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
629 type,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
630 body_plain,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
631 body_rich,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
632 title,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
633 requires_action,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
634 priority,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
635 expire_at,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
636 extra,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
637 profile,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
638 ):
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
639 self._obj.emitSignal(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
640 "notification_new",
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
641 id,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
642 timestamp,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
643 type,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
644 body_plain,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
645 body_rich,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
646 title,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
647 requires_action,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
648 priority,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
649 expire_at,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
650 extra,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
651 profile,
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
652 )
4130
02f0adc745c6 core: notifications implementation, first draft:
Goffi <goffi@goffi.org>
parents: 4071
diff changeset
653
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
654 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
655 self._obj.emitSignal("param_update", name, value, category, profile)
267
bdcd535e179e Bridge constructor:
Goffi <goffi@goffi.org>
parents: 266
diff changeset
656
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
657 def presence_update(self, entity_jid, show, priority, statuses, profile):
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
658 self._obj.emitSignal(
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
659 "presence_update", entity_jid, show, priority, statuses, profile
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
660 )
49
9c79eb49d51f DBus bridge improvment:
Goffi <goffi@goffi.org>
parents: 37
diff changeset
661
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
662 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
663 self._obj.emitSignal("progress_error", id, error, profile)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
664
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
665 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
666 self._obj.emitSignal("progress_finished", id, metadata, profile)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
667
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
668 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
669 self._obj.emitSignal("progress_started", id, metadata, profile)
1522
7d7e57a84792 core: progression handling improvments:
Goffi <goffi@goffi.org>
parents: 1482
diff changeset
670
387
e66d300c5d42 frontends, bridge: sendFile method signature change + jid parameters in bridge now use _jid suffix
Goffi <goffi@goffi.org>
parents: 371
diff changeset
671 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
672 self._obj.emitSignal("subscribe", sub_type, entity_jid, profile)
0
goffi@necton2
parents:
diff changeset
673
2086
4633cfcbcccb bridge (D-Bus): bad design fixes:
Goffi <goffi@goffi.org>
parents: 2085
diff changeset
674 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
675 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
676 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
677
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
678 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
679 self._obj.emitSignal(name, *args)
0
goffi@necton2
parents:
diff changeset
680
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
681 def add_method(
4270
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
682 self, name, int_suffix, in_sign, out_sign, method, async_=False, doc={}
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
683 ):
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
684 """Dynamically add a method to D-Bus bridge"""
2624
56f94936df1e code style reformatting using black
Goffi <goffi@goffi.org>
parents: 2595
diff changeset
685 # 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
686 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
687 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
688 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
689 )
4270
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
690
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
691 # 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
692 # 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
693 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
694 return self_._callback(name, *args, **kwargs)
4270
0d7bb4df2343 Reformatted code base using black.
Goffi <goffi@goffi.org>
parents: 4193
diff changeset
695
3539
60d3861e5996 bridge (dbus): use Tx DBus for backend part of D-Bus bridge:
Goffi <goffi@goffi.org>
parents: 3480
diff changeset
696 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
697 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
698
4037
524856bd7b19 massive refactoring to switch from camelCase to snake_case:
Goffi <goffi@goffi.org>
parents: 3539
diff changeset
699 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
700 """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
701 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
702 self._obj.plugin_iface.addSignal(Signal(name, signature))
4284
3a550e9a2b55 black reformatting
Goffi <goffi@goffi.org>
parents: 4280
diff changeset
703 setattr(bridge, name, partialmethod(bridge.emit_signal, name))