comparison libervia/backend/bridge/dbus_bridge.py @ 4280:4cf98f506269

bridge(constructor): fix template parsing, which was broken following `black` reformating.
author Goffi <goffi@goffi.org>
date Fri, 12 Jul 2024 17:58:06 +0200
parents 0d7bb4df2343
children 3a550e9a2b55
comparison
equal deleted inserted replaced
4279:6276242736c3 4280:4cf98f506269
84 84
85 class DBusObject(objects.DBusObject): 85 class DBusObject(objects.DBusObject):
86 86
87 core_iface = DBusInterface( 87 core_iface = DBusInterface(
88 const_INT_PREFIX + const_CORE_SUFFIX, 88 const_INT_PREFIX + const_CORE_SUFFIX,
89 Method("action_launch", arguments="sss", returns="s"), 89 Method('action_launch', arguments='sss', returns='s'),
90 Method("actions_get", arguments="s", returns="a(ssi)"), 90 Method('actions_get', arguments='s', returns='a(ssi)'),
91 Method("config_get", arguments="ss", returns="s"), 91 Method('config_get', arguments='ss', returns='s'),
92 Method("connect", arguments="ssa{ss}", returns="b"), 92 Method('connect', arguments='ssa{ss}', returns='b'),
93 Method("contact_add", arguments="ss", returns=""), 93 Method('contact_add', arguments='ss', returns=''),
94 Method("contact_del", arguments="ss", returns=""), 94 Method('contact_del', arguments='ss', returns=''),
95 Method("contact_get", arguments="ss", returns="(a{ss}as)"), 95 Method('contact_get', arguments='ss', returns='(a{ss}as)'),
96 Method("contact_update", arguments="ssass", returns=""), 96 Method('contact_update', arguments='ssass', returns=''),
97 Method("contacts_get", arguments="s", returns="a(sa{ss}as)"), 97 Method('contacts_get', arguments='s', returns='a(sa{ss}as)'),
98 Method("contacts_get_from_group", arguments="ss", returns="as"), 98 Method('contacts_get_from_group', arguments='ss', returns='as'),
99 Method("devices_infos_get", arguments="ss", returns="s"), 99 Method('devices_infos_get', arguments='ss', returns='s'),
100 Method( 100 Method('disco_find_by_features', arguments='asa(ss)bbbbbs', returns='(a{sa(sss)}a{sa(sss)}a{sa(sss)})'),
101 "disco_find_by_features", 101 Method('disco_infos', arguments='ssbs', returns='(asa(sss)a{sa(a{ss}as)})'),
102 arguments="asa(ss)bbbbbs", 102 Method('disco_items', arguments='ssbs', returns='a(sss)'),
103 returns="(a{sa(sss)}a{sa(sss)}a{sa(sss)})", 103 Method('disconnect', arguments='s', returns=''),
104 ), 104 Method('encryption_namespace_get', arguments='s', returns='s'),
105 Method("disco_infos", arguments="ssbs", returns="(asa(sss)a{sa(a{ss}as)})"), 105 Method('encryption_plugins_get', arguments='', returns='s'),
106 Method("disco_items", arguments="ssbs", returns="a(sss)"), 106 Method('encryption_trust_ui_get', arguments='sss', returns='s'),
107 Method("disconnect", arguments="s", returns=""), 107 Method('entities_data_get', arguments='asass', returns='a{sa{ss}}'),
108 Method("encryption_namespace_get", arguments="s", returns="s"), 108 Method('entity_data_get', arguments='sass', returns='a{ss}'),
109 Method("encryption_plugins_get", arguments="", returns="s"), 109 Method('features_get', arguments='s', returns='a{sa{ss}}'),
110 Method("encryption_trust_ui_get", arguments="sss", returns="s"), 110 Method('history_get', arguments='ssiba{ss}s', returns='a(sdssa{ss}a{ss}ss)'),
111 Method("entities_data_get", arguments="asass", returns="a{sa{ss}}"), 111 Method('image_check', arguments='s', returns='s'),
112 Method("entity_data_get", arguments="sass", returns="a{ss}"), 112 Method('image_convert', arguments='ssss', returns='s'),
113 Method("features_get", arguments="s", returns="a{sa{ss}}"), 113 Method('image_generate_preview', arguments='ss', returns='s'),
114 Method("history_get", arguments="ssiba{ss}s", returns="a(sdssa{ss}a{ss}ss)"), 114 Method('image_resize', arguments='sii', returns='s'),
115 Method("image_check", arguments="s", returns="s"), 115 Method('init_pre_script', arguments='', returns=''),
116 Method("image_convert", arguments="ssss", returns="s"), 116 Method('is_connected', arguments='s', returns='b'),
117 Method("image_generate_preview", arguments="ss", returns="s"), 117 Method('main_resource_get', arguments='ss', returns='s'),
118 Method("image_resize", arguments="sii", returns="s"), 118 Method('menu_help_get', arguments='ss', returns='s'),
119 Method("init_pre_script", arguments="", returns=""), 119 Method('menu_launch', arguments='sasa{ss}is', returns='a{ss}'),
120 Method("is_connected", arguments="s", returns="b"), 120 Method('menus_get', arguments='si', returns='a(ssasasa{ss})'),
121 Method("main_resource_get", arguments="ss", returns="s"), 121 Method('message_encryption_get', arguments='ss', returns='s'),
122 Method("menu_help_get", arguments="ss", returns="s"), 122 Method('message_encryption_start', arguments='ssbs', returns=''),
123 Method("menu_launch", arguments="sasa{ss}is", returns="a{ss}"), 123 Method('message_encryption_stop', arguments='ss', returns=''),
124 Method("menus_get", arguments="si", returns="a(ssasasa{ss})"), 124 Method('message_send', arguments='sa{ss}a{ss}sss', returns=''),
125 Method("message_encryption_get", arguments="ss", returns="s"), 125 Method('namespaces_get', arguments='', returns='a{ss}'),
126 Method("message_encryption_start", arguments="ssbs", returns=""), 126 Method('notification_add', arguments='ssssbbsdss', returns=''),
127 Method("message_encryption_stop", arguments="ss", returns=""), 127 Method('notification_delete', arguments='sbs', returns=''),
128 Method("message_send", arguments="sa{ss}a{ss}sss", returns=""), 128 Method('notifications_expired_clean', arguments='ds', returns=''),
129 Method("namespaces_get", arguments="", returns="a{ss}"), 129 Method('notifications_get', arguments='ss', returns='s'),
130 Method("notification_add", arguments="ssssbbsdss", returns=""), 130 Method('param_get_a', arguments='ssss', returns='s'),
131 Method("notification_delete", arguments="sbs", returns=""), 131 Method('param_get_a_async', arguments='sssis', returns='s'),
132 Method("notifications_expired_clean", arguments="ds", returns=""), 132 Method('param_set', arguments='sssis', returns=''),
133 Method("notifications_get", arguments="ss", returns="s"), 133 Method('param_ui_get', arguments='isss', returns='s'),
134 Method("param_get_a", arguments="ssss", returns="s"), 134 Method('params_categories_get', arguments='', returns='as'),
135 Method("param_get_a_async", arguments="sssis", returns="s"), 135 Method('params_register_app', arguments='sis', returns=''),
136 Method("param_set", arguments="sssis", returns=""), 136 Method('params_template_load', arguments='s', returns='b'),
137 Method("param_ui_get", arguments="isss", returns="s"), 137 Method('params_template_save', arguments='s', returns='b'),
138 Method("params_categories_get", arguments="", returns="as"), 138 Method('params_values_from_category_get_async', arguments='sisss', returns='a{ss}'),
139 Method("params_register_app", arguments="sis", returns=""), 139 Method('presence_set', arguments='ssa{ss}s', returns=''),
140 Method("params_template_load", arguments="s", returns="b"), 140 Method('presence_statuses_get', arguments='s', returns='a{sa{s(sia{ss})}}'),
141 Method("params_template_save", arguments="s", returns="b"), 141 Method('private_data_delete', arguments='sss', returns=''),
142 Method( 142 Method('private_data_get', arguments='sss', returns='s'),
143 "params_values_from_category_get_async", arguments="sisss", returns="a{ss}" 143 Method('private_data_set', arguments='ssss', returns=''),
144 ), 144 Method('profile_create', arguments='sss', returns=''),
145 Method("presence_set", arguments="ssa{ss}s", returns=""), 145 Method('profile_delete_async', arguments='s', returns=''),
146 Method("presence_statuses_get", arguments="s", returns="a{sa{s(sia{ss})}}"), 146 Method('profile_is_session_started', arguments='s', returns='b'),
147 Method("private_data_delete", arguments="sss", returns=""), 147 Method('profile_name_get', arguments='s', returns='s'),
148 Method("private_data_get", arguments="sss", returns="s"), 148 Method('profile_set_default', arguments='s', returns=''),
149 Method("private_data_set", arguments="ssss", returns=""), 149 Method('profile_start_session', arguments='ss', returns='b'),
150 Method("profile_create", arguments="sss", returns=""), 150 Method('profiles_list_get', arguments='bb', returns='as'),
151 Method("profile_delete_async", arguments="s", returns=""), 151 Method('progress_get', arguments='ss', returns='a{ss}'),
152 Method("profile_is_session_started", arguments="s", returns="b"), 152 Method('progress_get_all', arguments='s', returns='a{sa{sa{ss}}}'),
153 Method("profile_name_get", arguments="s", returns="s"), 153 Method('progress_get_all_metadata', arguments='s', returns='a{sa{sa{ss}}}'),
154 Method("profile_set_default", arguments="s", returns=""), 154 Method('ready_get', arguments='', returns=''),
155 Method("profile_start_session", arguments="ss", returns="b"), 155 Method('roster_resync', arguments='s', returns=''),
156 Method("profiles_list_get", arguments="bb", returns="as"), 156 Method('session_infos_get', arguments='s', returns='a{ss}'),
157 Method("progress_get", arguments="ss", returns="a{ss}"), 157 Method('sub_waiting_get', arguments='s', returns='a{ss}'),
158 Method("progress_get_all", arguments="s", returns="a{sa{sa{ss}}}"), 158 Method('subscription', arguments='sss', returns=''),
159 Method("progress_get_all_metadata", arguments="s", returns="a{sa{sa{ss}}}"), 159 Method('version_get', arguments='', returns='s'),
160 Method("ready_get", arguments="", returns=""), 160 Signal('_debug', 'sa{ss}s'),
161 Method("roster_resync", arguments="s", returns=""), 161 Signal('action_new', 'ssis'),
162 Method("session_infos_get", arguments="s", returns="a{ss}"), 162 Signal('connected', 'ss'),
163 Method("sub_waiting_get", arguments="s", returns="a{ss}"), 163 Signal('contact_deleted', 'ss'),
164 Method("subscription", arguments="sss", returns=""), 164 Signal('contact_new', 'sa{ss}ass'),
165 Method("version_get", arguments="", returns="s"), 165 Signal('disconnected', 's'),
166 Signal("_debug", "sa{ss}s"), 166 Signal('entity_data_updated', 'ssss'),
167 Signal("action_new", "ssis"), 167 Signal('message_encryption_started', 'sss'),
168 Signal("connected", "ss"), 168 Signal('message_encryption_stopped', 'sa{ss}s'),
169 Signal("contact_deleted", "ss"), 169 Signal('message_new', 'sdssa{ss}a{ss}sss'),
170 Signal("contact_new", "sa{ss}ass"), 170 Signal('message_update', 'ssss'),
171 Signal("disconnected", "s"), 171 Signal('notification_deleted', 'ss'),
172 Signal("entity_data_updated", "ssss"), 172 Signal('notification_new', 'sdssssbidss'),
173 Signal("message_encryption_started", "sss"), 173 Signal('param_update', 'ssss'),
174 Signal("message_encryption_stopped", "sa{ss}s"), 174 Signal('presence_update', 'ssia{ss}s'),
175 Signal("message_new", "sdssa{ss}a{ss}sss"), 175 Signal('progress_error', 'sss'),
176 Signal("message_update", "ssss"), 176 Signal('progress_finished', 'sa{ss}s'),
177 Signal("notification_deleted", "ss"), 177 Signal('progress_started', 'sa{ss}s'),
178 Signal("notification_new", "sdssssbidss"), 178 Signal('subscribe', 'sss'),
179 Signal("param_update", "ssss"),
180 Signal("presence_update", "ssia{ss}s"),
181 Signal("progress_error", "sss"),
182 Signal("progress_finished", "sa{ss}s"),
183 Signal("progress_started", "sa{ss}s"),
184 Signal("subscribe", "sss"),
185 ) 179 )
186 plugin_iface = DBusInterface(const_INT_PREFIX + const_PLUGIN_SUFFIX) 180 plugin_iface = DBusInterface(const_INT_PREFIX + const_PLUGIN_SUFFIX)
187 181
188 dbusInterfaces = [core_iface, plugin_iface] 182 dbusInterfaces = [core_iface, plugin_iface]
189 183
204 else: 198 else:
205 d = defer.maybeDeferred(cb, *args, **kwargs) 199 d = defer.maybeDeferred(cb, *args, **kwargs)
206 d.addErrback(GenericException.create_and_raise) 200 d.addErrback(GenericException.create_and_raise)
207 return d 201 return d
208 202
203
209 def dbus_action_launch(self, callback_id, data, profile_key="@DEFAULT@"): 204 def dbus_action_launch(self, callback_id, data, profile_key="@DEFAULT@"):
210 return self._callback("action_launch", callback_id, data, profile_key) 205 return self._callback("action_launch", callback_id, data, profile_key)
211 206
212 def dbus_actions_get(self, profile_key="@DEFAULT@"): 207 def dbus_actions_get(self, profile_key="@DEFAULT@"):
213 return self._callback("actions_get", profile_key) 208 return self._callback("actions_get", profile_key)
214 209
215 def dbus_config_get(self, section, name): 210 def dbus_config_get(self, section, name):
216 return self._callback("config_get", section, name) 211 return self._callback("config_get", section, name)
217 212
218 def dbus_connect(self, profile_key="@DEFAULT@", password="", options={}): 213 def dbus_connect(self, profile_key="@DEFAULT@", password='', options={}):
219 return self._callback("connect", profile_key, password, options) 214 return self._callback("connect", profile_key, password, options)
220 215
221 def dbus_contact_add(self, entity_jid, profile_key="@DEFAULT@"): 216 def dbus_contact_add(self, entity_jid, profile_key="@DEFAULT@"):
222 return self._callback("contact_add", entity_jid, profile_key) 217 return self._callback("contact_add", entity_jid, profile_key)
223 218
237 return self._callback("contacts_get_from_group", group, profile_key) 232 return self._callback("contacts_get_from_group", group, profile_key)
238 233
239 def dbus_devices_infos_get(self, bare_jid, profile_key): 234 def dbus_devices_infos_get(self, bare_jid, profile_key):
240 return self._callback("devices_infos_get", bare_jid, profile_key) 235 return self._callback("devices_infos_get", bare_jid, profile_key)
241 236
242 def dbus_disco_find_by_features( 237 def dbus_disco_find_by_features(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@"):
243 self, 238 return self._callback("disco_find_by_features", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key)
244 namespaces, 239
245 identities, 240 def dbus_disco_infos(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"):
246 bare_jid=False,
247 service=True,
248 roster=True,
249 own_jid=True,
250 local_device=False,
251 profile_key="@DEFAULT@",
252 ):
253 return self._callback(
254 "disco_find_by_features",
255 namespaces,
256 identities,
257 bare_jid,
258 service,
259 roster,
260 own_jid,
261 local_device,
262 profile_key,
263 )
264
265 def dbus_disco_infos(
266 self, entity_jid, node="", use_cache=True, profile_key="@DEFAULT@"
267 ):
268 return self._callback("disco_infos", entity_jid, node, use_cache, profile_key) 241 return self._callback("disco_infos", entity_jid, node, use_cache, profile_key)
269 242
270 def dbus_disco_items( 243 def dbus_disco_items(self, entity_jid, node=u'', use_cache=True, profile_key="@DEFAULT@"):
271 self, entity_jid, node="", use_cache=True, profile_key="@DEFAULT@"
272 ):
273 return self._callback("disco_items", entity_jid, node, use_cache, profile_key) 244 return self._callback("disco_items", entity_jid, node, use_cache, profile_key)
274 245
275 def dbus_disconnect(self, profile_key="@DEFAULT@"): 246 def dbus_disconnect(self, profile_key="@DEFAULT@"):
276 return self._callback("disconnect", profile_key) 247 return self._callback("disconnect", profile_key)
277 248
278 def dbus_encryption_namespace_get(self, arg_0): 249 def dbus_encryption_namespace_get(self, arg_0):
279 return self._callback("encryption_namespace_get", arg_0) 250 return self._callback("encryption_namespace_get", arg_0)
280 251
281 def dbus_encryption_plugins_get( 252 def dbus_encryption_plugins_get(self, ):
282 self, 253 return self._callback("encryption_plugins_get", )
283 ):
284 return self._callback(
285 "encryption_plugins_get",
286 )
287 254
288 def dbus_encryption_trust_ui_get(self, to_jid, namespace, profile_key): 255 def dbus_encryption_trust_ui_get(self, to_jid, namespace, profile_key):
289 return self._callback("encryption_trust_ui_get", to_jid, namespace, profile_key) 256 return self._callback("encryption_trust_ui_get", to_jid, namespace, profile_key)
290 257
291 def dbus_entities_data_get(self, jids, keys, profile): 258 def dbus_entities_data_get(self, jids, keys, profile):
295 return self._callback("entity_data_get", jid, keys, profile) 262 return self._callback("entity_data_get", jid, keys, profile)
296 263
297 def dbus_features_get(self, profile_key): 264 def dbus_features_get(self, profile_key):
298 return self._callback("features_get", profile_key) 265 return self._callback("features_get", profile_key)
299 266
300 def dbus_history_get( 267 def dbus_history_get(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@"):
301 self, from_jid, to_jid, limit, between=True, filters="", profile="@NONE@" 268 return self._callback("history_get", from_jid, to_jid, limit, between, filters, profile)
302 ):
303 return self._callback(
304 "history_get", from_jid, to_jid, limit, between, filters, profile
305 )
306 269
307 def dbus_image_check(self, arg_0): 270 def dbus_image_check(self, arg_0):
308 return self._callback("image_check", arg_0) 271 return self._callback("image_check", arg_0)
309 272
310 def dbus_image_convert(self, source, dest, arg_2, extra): 273 def dbus_image_convert(self, source, dest, arg_2, extra):
314 return self._callback("image_generate_preview", image_path, profile_key) 277 return self._callback("image_generate_preview", image_path, profile_key)
315 278
316 def dbus_image_resize(self, image_path, width, height): 279 def dbus_image_resize(self, image_path, width, height):
317 return self._callback("image_resize", image_path, width, height) 280 return self._callback("image_resize", image_path, width, height)
318 281
319 def dbus_init_pre_script( 282 def dbus_init_pre_script(self, ):
320 self, 283 return self._callback("init_pre_script", )
321 ):
322 return self._callback(
323 "init_pre_script",
324 )
325 284
326 def dbus_is_connected(self, profile_key="@DEFAULT@"): 285 def dbus_is_connected(self, profile_key="@DEFAULT@"):
327 return self._callback("is_connected", profile_key) 286 return self._callback("is_connected", profile_key)
328 287
329 def dbus_main_resource_get(self, contact_jid, profile_key="@DEFAULT@"): 288 def dbus_main_resource_get(self, contact_jid, profile_key="@DEFAULT@"):
331 290
332 def dbus_menu_help_get(self, menu_id, language): 291 def dbus_menu_help_get(self, menu_id, language):
333 return self._callback("menu_help_get", menu_id, language) 292 return self._callback("menu_help_get", menu_id, language)
334 293
335 def dbus_menu_launch(self, menu_type, path, data, security_limit, profile_key): 294 def dbus_menu_launch(self, menu_type, path, data, security_limit, profile_key):
336 return self._callback( 295 return self._callback("menu_launch", menu_type, path, data, security_limit, profile_key)
337 "menu_launch", menu_type, path, data, security_limit, profile_key
338 )
339 296
340 def dbus_menus_get(self, language, security_limit): 297 def dbus_menus_get(self, language, security_limit):
341 return self._callback("menus_get", language, security_limit) 298 return self._callback("menus_get", language, security_limit)
342 299
343 def dbus_message_encryption_get(self, to_jid, profile_key): 300 def dbus_message_encryption_get(self, to_jid, profile_key):
344 return self._callback("message_encryption_get", to_jid, profile_key) 301 return self._callback("message_encryption_get", to_jid, profile_key)
345 302
346 def dbus_message_encryption_start( 303 def dbus_message_encryption_start(self, to_jid, namespace='', replace=False, profile_key="@NONE@"):
347 self, to_jid, namespace="", replace=False, profile_key="@NONE@" 304 return self._callback("message_encryption_start", to_jid, namespace, replace, profile_key)
348 ):
349 return self._callback(
350 "message_encryption_start", to_jid, namespace, replace, profile_key
351 )
352 305
353 def dbus_message_encryption_stop(self, to_jid, profile_key): 306 def dbus_message_encryption_stop(self, to_jid, profile_key):
354 return self._callback("message_encryption_stop", to_jid, profile_key) 307 return self._callback("message_encryption_stop", to_jid, profile_key)
355 308
356 def dbus_message_send( 309 def dbus_message_send(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@"):
357 self, 310 return self._callback("message_send", to_jid, message, subject, mess_type, extra, profile_key)
358 to_jid, 311
359 message, 312 def dbus_namespaces_get(self, ):
360 subject={}, 313 return self._callback("namespaces_get", )
361 mess_type="auto", 314
362 extra={}, 315 def dbus_notification_add(self, type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra):
363 profile_key="@NONE@", 316 return self._callback("notification_add", type_, body_plain, body_rich, title, is_global, requires_action, arg_6, priority, expire_at, extra)
364 ):
365 return self._callback(
366 "message_send", to_jid, message, subject, mess_type, extra, profile_key
367 )
368
369 def dbus_namespaces_get(
370 self,
371 ):
372 return self._callback(
373 "namespaces_get",
374 )
375
376 def dbus_notification_add(
377 self,
378 type_,
379 body_plain,
380 body_rich,
381 title,
382 is_global,
383 requires_action,
384 arg_6,
385 priority,
386 expire_at,
387 extra,
388 ):
389 return self._callback(
390 "notification_add",
391 type_,
392 body_plain,
393 body_rich,
394 title,
395 is_global,
396 requires_action,
397 arg_6,
398 priority,
399 expire_at,
400 extra,
401 )
402 317
403 def dbus_notification_delete(self, id_, is_global, profile_key): 318 def dbus_notification_delete(self, id_, is_global, profile_key):
404 return self._callback("notification_delete", id_, is_global, profile_key) 319 return self._callback("notification_delete", id_, is_global, profile_key)
405 320
406 def dbus_notifications_expired_clean(self, limit_timestamp, profile_key): 321 def dbus_notifications_expired_clean(self, limit_timestamp, profile_key):
407 return self._callback("notifications_expired_clean", limit_timestamp, profile_key) 322 return self._callback("notifications_expired_clean", limit_timestamp, profile_key)
408 323
409 def dbus_notifications_get(self, filters, profile_key): 324 def dbus_notifications_get(self, filters, profile_key):
410 return self._callback("notifications_get", filters, profile_key) 325 return self._callback("notifications_get", filters, profile_key)
411 326
412 def dbus_param_get_a( 327 def dbus_param_get_a(self, name, category, attribute="value", profile_key="@DEFAULT@"):
413 self, name, category, attribute="value", profile_key="@DEFAULT@"
414 ):
415 return self._callback("param_get_a", name, category, attribute, profile_key) 328 return self._callback("param_get_a", name, category, attribute, profile_key)
416 329
417 def dbus_param_get_a_async( 330 def dbus_param_get_a_async(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@"):
418 self, 331 return self._callback("param_get_a_async", name, category, attribute, security_limit, profile_key)
419 name, 332
420 category, 333 def dbus_param_set(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"):
421 attribute="value", 334 return self._callback("param_set", name, value, category, security_limit, profile_key)
422 security_limit=-1, 335
423 profile_key="@DEFAULT@", 336 def dbus_param_ui_get(self, security_limit=-1, app='', extra='', profile_key="@DEFAULT@"):
424 ):
425 return self._callback(
426 "param_get_a_async", name, category, attribute, security_limit, profile_key
427 )
428
429 def dbus_param_set(
430 self, name, value, category, security_limit=-1, profile_key="@DEFAULT@"
431 ):
432 return self._callback(
433 "param_set", name, value, category, security_limit, profile_key
434 )
435
436 def dbus_param_ui_get(
437 self, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"
438 ):
439 return self._callback("param_ui_get", security_limit, app, extra, profile_key) 337 return self._callback("param_ui_get", security_limit, app, extra, profile_key)
440 338
441 def dbus_params_categories_get( 339 def dbus_params_categories_get(self, ):
442 self, 340 return self._callback("params_categories_get", )
443 ): 341
444 return self._callback( 342 def dbus_params_register_app(self, xml, security_limit=-1, app=''):
445 "params_categories_get",
446 )
447
448 def dbus_params_register_app(self, xml, security_limit=-1, app=""):
449 return self._callback("params_register_app", xml, security_limit, app) 343 return self._callback("params_register_app", xml, security_limit, app)
450 344
451 def dbus_params_template_load(self, filename): 345 def dbus_params_template_load(self, filename):
452 return self._callback("params_template_load", filename) 346 return self._callback("params_template_load", filename)
453 347
454 def dbus_params_template_save(self, filename): 348 def dbus_params_template_save(self, filename):
455 return self._callback("params_template_save", filename) 349 return self._callback("params_template_save", filename)
456 350
457 def dbus_params_values_from_category_get_async( 351 def dbus_params_values_from_category_get_async(self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@"):
458 self, category, security_limit=-1, app="", extra="", profile_key="@DEFAULT@" 352 return self._callback("params_values_from_category_get_async", category, security_limit, app, extra, profile_key)
459 ): 353
460 return self._callback( 354 def dbus_presence_set(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@"):
461 "params_values_from_category_get_async",
462 category,
463 security_limit,
464 app,
465 extra,
466 profile_key,
467 )
468
469 def dbus_presence_set(self, to_jid="", show="", statuses={}, profile_key="@DEFAULT@"):
470 return self._callback("presence_set", to_jid, show, statuses, profile_key) 355 return self._callback("presence_set", to_jid, show, statuses, profile_key)
471 356
472 def dbus_presence_statuses_get(self, profile_key="@DEFAULT@"): 357 def dbus_presence_statuses_get(self, profile_key="@DEFAULT@"):
473 return self._callback("presence_statuses_get", profile_key) 358 return self._callback("presence_statuses_get", profile_key)
474 359
479 return self._callback("private_data_get", namespace, key, profile_key) 364 return self._callback("private_data_get", namespace, key, profile_key)
480 365
481 def dbus_private_data_set(self, namespace, key, data, profile_key): 366 def dbus_private_data_set(self, namespace, key, data, profile_key):
482 return self._callback("private_data_set", namespace, key, data, profile_key) 367 return self._callback("private_data_set", namespace, key, data, profile_key)
483 368
484 def dbus_profile_create(self, profile, password="", component=""): 369 def dbus_profile_create(self, profile, password='', component=''):
485 return self._callback("profile_create", profile, password, component) 370 return self._callback("profile_create", profile, password, component)
486 371
487 def dbus_profile_delete_async(self, profile): 372 def dbus_profile_delete_async(self, profile):
488 return self._callback("profile_delete_async", profile) 373 return self._callback("profile_delete_async", profile)
489 374
494 return self._callback("profile_name_get", profile_key) 379 return self._callback("profile_name_get", profile_key)
495 380
496 def dbus_profile_set_default(self, profile): 381 def dbus_profile_set_default(self, profile):
497 return self._callback("profile_set_default", profile) 382 return self._callback("profile_set_default", profile)
498 383
499 def dbus_profile_start_session(self, password="", profile_key="@DEFAULT@"): 384 def dbus_profile_start_session(self, password='', profile_key="@DEFAULT@"):
500 return self._callback("profile_start_session", password, profile_key) 385 return self._callback("profile_start_session", password, profile_key)
501 386
502 def dbus_profiles_list_get(self, clients=True, components=False): 387 def dbus_profiles_list_get(self, clients=True, components=False):
503 return self._callback("profiles_list_get", clients, components) 388 return self._callback("profiles_list_get", clients, components)
504 389
509 return self._callback("progress_get_all", profile) 394 return self._callback("progress_get_all", profile)
510 395
511 def dbus_progress_get_all_metadata(self, profile): 396 def dbus_progress_get_all_metadata(self, profile):
512 return self._callback("progress_get_all_metadata", profile) 397 return self._callback("progress_get_all_metadata", profile)
513 398
514 def dbus_ready_get( 399 def dbus_ready_get(self, ):
515 self, 400 return self._callback("ready_get", )
516 ):
517 return self._callback(
518 "ready_get",
519 )
520 401
521 def dbus_roster_resync(self, profile_key="@DEFAULT@"): 402 def dbus_roster_resync(self, profile_key="@DEFAULT@"):
522 return self._callback("roster_resync", profile_key) 403 return self._callback("roster_resync", profile_key)
523 404
524 def dbus_session_infos_get(self, profile_key): 405 def dbus_session_infos_get(self, profile_key):
528 return self._callback("sub_waiting_get", profile_key) 409 return self._callback("sub_waiting_get", profile_key)
529 410
530 def dbus_subscription(self, sub_type, entity, profile_key="@DEFAULT@"): 411 def dbus_subscription(self, sub_type, entity, profile_key="@DEFAULT@"):
531 return self._callback("subscription", sub_type, entity, profile_key) 412 return self._callback("subscription", sub_type, entity, profile_key)
532 413
533 def dbus_version_get( 414 def dbus_version_get(self, ):
534 self, 415 return self._callback("version_get", )
535 ): 416
536 return self._callback(
537 "version_get",
538 )
539 417
540 418
541 class bridge: 419 class bridge:
542 420
543 def __init__(self): 421 def __init__(self):
580 458
581 def entity_data_updated(self, jid, name, value, profile): 459 def entity_data_updated(self, jid, name, value, profile):
582 self._obj.emitSignal("entity_data_updated", jid, name, value, profile) 460 self._obj.emitSignal("entity_data_updated", jid, name, value, profile)
583 461
584 def message_encryption_started(self, to_jid, encryption_data, profile_key): 462 def message_encryption_started(self, to_jid, encryption_data, profile_key):
585 self._obj.emitSignal( 463 self._obj.emitSignal("message_encryption_started", to_jid, encryption_data, profile_key)
586 "message_encryption_started", to_jid, encryption_data, profile_key
587 )
588 464
589 def message_encryption_stopped(self, to_jid, encryption_data, profile_key): 465 def message_encryption_stopped(self, to_jid, encryption_data, profile_key):
590 self._obj.emitSignal( 466 self._obj.emitSignal("message_encryption_stopped", to_jid, encryption_data, profile_key)
591 "message_encryption_stopped", to_jid, encryption_data, profile_key 467
592 ) 468 def message_new(self, uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile):
593 469 self._obj.emitSignal("message_new", uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile)
594 def message_new(
595 self,
596 uid,
597 timestamp,
598 from_jid,
599 to_jid,
600 message,
601 subject,
602 mess_type,
603 extra,
604 profile,
605 ):
606 self._obj.emitSignal(
607 "message_new",
608 uid,
609 timestamp,
610 from_jid,
611 to_jid,
612 message,
613 subject,
614 mess_type,
615 extra,
616 profile,
617 )
618 470
619 def message_update(self, uid, message_type, message_data, profile): 471 def message_update(self, uid, message_type, message_data, profile):
620 self._obj.emitSignal("message_update", uid, message_type, message_data, profile) 472 self._obj.emitSignal("message_update", uid, message_type, message_data, profile)
621 473
622 def notification_deleted(self, id, profile): 474 def notification_deleted(self, id, profile):
623 self._obj.emitSignal("notification_deleted", id, profile) 475 self._obj.emitSignal("notification_deleted", id, profile)
624 476
625 def notification_new( 477 def notification_new(self, id, timestamp, type, body_plain, body_rich, title, requires_action, priority, expire_at, extra, profile):
626 self, 478 self._obj.emitSignal("notification_new", id, timestamp, type, body_plain, body_rich, title, requires_action, priority, expire_at, extra, profile)
627 id,
628 timestamp,
629 type,
630 body_plain,
631 body_rich,
632 title,
633 requires_action,
634 priority,
635 expire_at,
636 extra,
637 profile,
638 ):
639 self._obj.emitSignal(
640 "notification_new",
641 id,
642 timestamp,
643 type,
644 body_plain,
645 body_rich,
646 title,
647 requires_action,
648 priority,
649 expire_at,
650 extra,
651 profile,
652 )
653 479
654 def param_update(self, name, value, category, profile): 480 def param_update(self, name, value, category, profile):
655 self._obj.emitSignal("param_update", name, value, category, profile) 481 self._obj.emitSignal("param_update", name, value, category, profile)
656 482
657 def presence_update(self, entity_jid, show, priority, statuses, profile): 483 def presence_update(self, entity_jid, show, priority, statuses, profile):
658 self._obj.emitSignal( 484 self._obj.emitSignal("presence_update", entity_jid, show, priority, statuses, profile)
659 "presence_update", entity_jid, show, priority, statuses, profile
660 )
661 485
662 def progress_error(self, id, error, profile): 486 def progress_error(self, id, error, profile):
663 self._obj.emitSignal("progress_error", id, error, profile) 487 self._obj.emitSignal("progress_error", id, error, profile)
664 488
665 def progress_finished(self, id, metadata, profile): 489 def progress_finished(self, id, metadata, profile):