Mercurial > libervia-backend
comparison sat_frontends/bridge/pb.py @ 2628:779351da2c13
core, frontends: replaced org\.goffi namespaces by org.salutatoi + fixed generation:
generation of D-Bus bridge has been broken by black formatting tool, this patch fixes this.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 01 Jul 2018 20:37:58 +0200 |
parents | 56f94936df1e |
children | 712cb4ff3e13 |
comparison
equal
deleted
inserted
replaced
2627:163aab916bcf | 2628:779351da2c13 |
---|---|
123 d.addErrback(errback) | 123 d.addErrback(errback) |
124 | 124 |
125 def register_signal(self, functionName, handler, iface="core"): | 125 def register_signal(self, functionName, handler, iface="core"): |
126 self.signals_handler.register_signal(functionName, handler, iface) | 126 self.signals_handler.register_signal(functionName, handler, iface) |
127 | 127 |
128 | |
128 def actionsGet(self, profile_key="@DEFAULT@", callback=None, errback=None): | 129 def actionsGet(self, profile_key="@DEFAULT@", callback=None, errback=None): |
129 d = self.root.callRemote("actionsGet", profile_key) | 130 d = self.root.callRemote("actionsGet", profile_key) |
130 if callback is not None: | 131 if callback is not None: |
131 d.addCallback(callback) | 132 d.addCallback(callback) |
132 if errback is None: | 133 if errback is None: |
133 errback = self._generic_errback | 134 errback = self._generic_errback |
134 d.addErrback(errback) | 135 d.addErrback(errback) |
135 | 136 |
136 def addContact( | 137 def addContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None): |
137 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None | |
138 ): | |
139 d = self.root.callRemote("addContact", entity_jid, profile_key) | 138 d = self.root.callRemote("addContact", entity_jid, profile_key) |
140 if callback is not None: | 139 if callback is not None: |
141 d.addCallback(lambda dummy: callback()) | 140 d.addCallback(lambda dummy: callback()) |
142 if errback is None: | 141 if errback is None: |
143 errback = self._generic_errback | 142 errback = self._generic_errback |
149 d.addCallback(lambda dummy: callback()) | 148 d.addCallback(lambda dummy: callback()) |
150 if errback is None: | 149 if errback is None: |
151 errback = self._generic_errback | 150 errback = self._generic_errback |
152 d.addErrback(errback) | 151 d.addErrback(errback) |
153 | 152 |
154 def asyncGetParamA( | 153 def asyncGetParamA(self, name, category, attribute="value", security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None): |
155 self, | 154 d = self.root.callRemote("asyncGetParamA", name, category, attribute, security_limit, profile_key) |
156 name, | 155 if callback is not None: |
157 category, | 156 d.addCallback(callback) |
158 attribute="value", | 157 if errback is None: |
159 security_limit=-1, | 158 errback = self._generic_errback |
160 profile_key="@DEFAULT@", | 159 d.addErrback(errback) |
161 callback=None, | 160 |
162 errback=None, | 161 def asyncGetParamsValuesFromCategory(self, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None): |
163 ): | 162 d = self.root.callRemote("asyncGetParamsValuesFromCategory", category, security_limit, profile_key) |
164 d = self.root.callRemote( | 163 if callback is not None: |
165 "asyncGetParamA", name, category, attribute, security_limit, profile_key | 164 d.addCallback(callback) |
166 ) | 165 if errback is None: |
167 if callback is not None: | 166 errback = self._generic_errback |
168 d.addCallback(callback) | 167 d.addErrback(errback) |
169 if errback is None: | 168 |
170 errback = self._generic_errback | 169 def connect(self, profile_key="@DEFAULT@", password='', options={}, callback=None, errback=None): |
171 d.addErrback(errback) | |
172 | |
173 def asyncGetParamsValuesFromCategory( | |
174 self, | |
175 category, | |
176 security_limit=-1, | |
177 profile_key="@DEFAULT@", | |
178 callback=None, | |
179 errback=None, | |
180 ): | |
181 d = self.root.callRemote( | |
182 "asyncGetParamsValuesFromCategory", category, security_limit, profile_key | |
183 ) | |
184 if callback is not None: | |
185 d.addCallback(callback) | |
186 if errback is None: | |
187 errback = self._generic_errback | |
188 d.addErrback(errback) | |
189 | |
190 def connect( | |
191 self, | |
192 profile_key="@DEFAULT@", | |
193 password="", | |
194 options={}, | |
195 callback=None, | |
196 errback=None, | |
197 ): | |
198 d = self.root.callRemote("connect", profile_key, password, options) | 170 d = self.root.callRemote("connect", profile_key, password, options) |
199 if callback is not None: | 171 if callback is not None: |
200 d.addCallback(callback) | 172 d.addCallback(callback) |
201 if errback is None: | 173 if errback is None: |
202 errback = self._generic_errback | 174 errback = self._generic_errback |
203 d.addErrback(errback) | 175 d.addErrback(errback) |
204 | 176 |
205 def delContact( | 177 def delContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None): |
206 self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None | |
207 ): | |
208 d = self.root.callRemote("delContact", entity_jid, profile_key) | 178 d = self.root.callRemote("delContact", entity_jid, profile_key) |
209 if callback is not None: | 179 if callback is not None: |
210 d.addCallback(lambda dummy: callback()) | 180 d.addCallback(lambda dummy: callback()) |
211 if errback is None: | 181 if errback is None: |
212 errback = self._generic_errback | 182 errback = self._generic_errback |
213 d.addErrback(errback) | 183 d.addErrback(errback) |
214 | 184 |
215 def discoFindByFeatures( | 185 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key=u"@DEFAULT@", callback=None, errback=None): |
216 self, | 186 d = self.root.callRemote("discoFindByFeatures", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key) |
217 namespaces, | 187 if callback is not None: |
218 identities, | 188 d.addCallback(callback) |
219 bare_jid=False, | 189 if errback is None: |
220 service=True, | 190 errback = self._generic_errback |
221 roster=True, | 191 d.addErrback(errback) |
222 own_jid=True, | 192 |
223 local_device=False, | 193 def discoInfos(self, entity_jid, node=u'', use_cache=True, profile_key=u"@DEFAULT@", callback=None, errback=None): |
224 profile_key=u"@DEFAULT@", | |
225 callback=None, | |
226 errback=None, | |
227 ): | |
228 d = self.root.callRemote( | |
229 "discoFindByFeatures", | |
230 namespaces, | |
231 identities, | |
232 bare_jid, | |
233 service, | |
234 roster, | |
235 own_jid, | |
236 local_device, | |
237 profile_key, | |
238 ) | |
239 if callback is not None: | |
240 d.addCallback(callback) | |
241 if errback is None: | |
242 errback = self._generic_errback | |
243 d.addErrback(errback) | |
244 | |
245 def discoInfos( | |
246 self, | |
247 entity_jid, | |
248 node=u"", | |
249 use_cache=True, | |
250 profile_key=u"@DEFAULT@", | |
251 callback=None, | |
252 errback=None, | |
253 ): | |
254 d = self.root.callRemote("discoInfos", entity_jid, node, use_cache, profile_key) | 194 d = self.root.callRemote("discoInfos", entity_jid, node, use_cache, profile_key) |
255 if callback is not None: | 195 if callback is not None: |
256 d.addCallback(callback) | 196 d.addCallback(callback) |
257 if errback is None: | 197 if errback is None: |
258 errback = self._generic_errback | 198 errback = self._generic_errback |
259 d.addErrback(errback) | 199 d.addErrback(errback) |
260 | 200 |
261 def discoItems( | 201 def discoItems(self, entity_jid, node=u'', use_cache=True, profile_key=u"@DEFAULT@", callback=None, errback=None): |
262 self, | |
263 entity_jid, | |
264 node=u"", | |
265 use_cache=True, | |
266 profile_key=u"@DEFAULT@", | |
267 callback=None, | |
268 errback=None, | |
269 ): | |
270 d = self.root.callRemote("discoItems", entity_jid, node, use_cache, profile_key) | 202 d = self.root.callRemote("discoItems", entity_jid, node, use_cache, profile_key) |
271 if callback is not None: | 203 if callback is not None: |
272 d.addCallback(callback) | 204 d.addCallback(callback) |
273 if errback is None: | 205 if errback is None: |
274 errback = self._generic_errback | 206 errback = self._generic_errback |
296 d.addCallback(callback) | 228 d.addCallback(callback) |
297 if errback is None: | 229 if errback is None: |
298 errback = self._generic_errback | 230 errback = self._generic_errback |
299 d.addErrback(errback) | 231 d.addErrback(errback) |
300 | 232 |
301 def getContactsFromGroup( | 233 def getContactsFromGroup(self, group, profile_key="@DEFAULT@", callback=None, errback=None): |
302 self, group, profile_key="@DEFAULT@", callback=None, errback=None | |
303 ): | |
304 d = self.root.callRemote("getContactsFromGroup", group, profile_key) | 234 d = self.root.callRemote("getContactsFromGroup", group, profile_key) |
305 if callback is not None: | 235 if callback is not None: |
306 d.addCallback(callback) | 236 d.addCallback(callback) |
307 if errback is None: | 237 if errback is None: |
308 errback = self._generic_errback | 238 errback = self._generic_errback |
330 d.addCallback(callback) | 260 d.addCallback(callback) |
331 if errback is None: | 261 if errback is None: |
332 errback = self._generic_errback | 262 errback = self._generic_errback |
333 d.addErrback(errback) | 263 d.addErrback(errback) |
334 | 264 |
335 def getMainResource( | 265 def getMainResource(self, contact_jid, profile_key="@DEFAULT@", callback=None, errback=None): |
336 self, contact_jid, profile_key="@DEFAULT@", callback=None, errback=None | |
337 ): | |
338 d = self.root.callRemote("getMainResource", contact_jid, profile_key) | 266 d = self.root.callRemote("getMainResource", contact_jid, profile_key) |
339 if callback is not None: | 267 if callback is not None: |
340 d.addCallback(callback) | 268 d.addCallback(callback) |
341 if errback is None: | 269 if errback is None: |
342 errback = self._generic_errback | 270 errback = self._generic_errback |
343 d.addErrback(errback) | 271 d.addErrback(errback) |
344 | 272 |
345 def getParamA( | 273 def getParamA(self, name, category, attribute="value", profile_key="@DEFAULT@", callback=None, errback=None): |
346 self, | |
347 name, | |
348 category, | |
349 attribute="value", | |
350 profile_key="@DEFAULT@", | |
351 callback=None, | |
352 errback=None, | |
353 ): | |
354 d = self.root.callRemote("getParamA", name, category, attribute, profile_key) | 274 d = self.root.callRemote("getParamA", name, category, attribute, profile_key) |
355 if callback is not None: | 275 if callback is not None: |
356 d.addCallback(callback) | 276 d.addCallback(callback) |
357 if errback is None: | 277 if errback is None: |
358 errback = self._generic_errback | 278 errback = self._generic_errback |
364 d.addCallback(callback) | 284 d.addCallback(callback) |
365 if errback is None: | 285 if errback is None: |
366 errback = self._generic_errback | 286 errback = self._generic_errback |
367 d.addErrback(errback) | 287 d.addErrback(errback) |
368 | 288 |
369 def getParamsUI( | 289 def getParamsUI(self, security_limit=-1, app='', profile_key="@DEFAULT@", callback=None, errback=None): |
370 self, | |
371 security_limit=-1, | |
372 app="", | |
373 profile_key="@DEFAULT@", | |
374 callback=None, | |
375 errback=None, | |
376 ): | |
377 d = self.root.callRemote("getParamsUI", security_limit, app, profile_key) | 290 d = self.root.callRemote("getParamsUI", security_limit, app, profile_key) |
378 if callback is not None: | 291 if callback is not None: |
379 d.addCallback(callback) | 292 d.addCallback(callback) |
380 if errback is None: | 293 if errback is None: |
381 errback = self._generic_errback | 294 errback = self._generic_errback |
411 d.addCallback(callback) | 324 d.addCallback(callback) |
412 if errback is None: | 325 if errback is None: |
413 errback = self._generic_errback | 326 errback = self._generic_errback |
414 d.addErrback(errback) | 327 d.addErrback(errback) |
415 | 328 |
416 def historyGet( | 329 def historyGet(self, from_jid, to_jid, limit, between=True, filters='', profile="@NONE@", callback=None, errback=None): |
417 self, | 330 d = self.root.callRemote("historyGet", from_jid, to_jid, limit, between, filters, profile) |
418 from_jid, | |
419 to_jid, | |
420 limit, | |
421 between=True, | |
422 filters="", | |
423 profile="@NONE@", | |
424 callback=None, | |
425 errback=None, | |
426 ): | |
427 d = self.root.callRemote( | |
428 "historyGet", from_jid, to_jid, limit, between, filters, profile | |
429 ) | |
430 if callback is not None: | 331 if callback is not None: |
431 d.addCallback(callback) | 332 d.addCallback(callback) |
432 if errback is None: | 333 if errback is None: |
433 errback = self._generic_errback | 334 errback = self._generic_errback |
434 d.addErrback(errback) | 335 d.addErrback(errback) |
439 d.addCallback(callback) | 340 d.addCallback(callback) |
440 if errback is None: | 341 if errback is None: |
441 errback = self._generic_errback | 342 errback = self._generic_errback |
442 d.addErrback(errback) | 343 d.addErrback(errback) |
443 | 344 |
444 def launchAction( | 345 def launchAction(self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None): |
445 self, callback_id, data, profile_key="@DEFAULT@", callback=None, errback=None | |
446 ): | |
447 d = self.root.callRemote("launchAction", callback_id, data, profile_key) | 346 d = self.root.callRemote("launchAction", callback_id, data, profile_key) |
448 if callback is not None: | 347 if callback is not None: |
449 d.addCallback(callback) | 348 d.addCallback(callback) |
450 if errback is None: | 349 if errback is None: |
451 errback = self._generic_errback | 350 errback = self._generic_errback |
465 d.addCallback(callback) | 364 d.addCallback(callback) |
466 if errback is None: | 365 if errback is None: |
467 errback = self._generic_errback | 366 errback = self._generic_errback |
468 d.addErrback(errback) | 367 d.addErrback(errback) |
469 | 368 |
470 def menuLaunch( | 369 def menuLaunch(self, menu_type, path, data, security_limit, profile_key, callback=None, errback=None): |
471 self, | 370 d = self.root.callRemote("menuLaunch", menu_type, path, data, security_limit, profile_key) |
472 menu_type, | |
473 path, | |
474 data, | |
475 security_limit, | |
476 profile_key, | |
477 callback=None, | |
478 errback=None, | |
479 ): | |
480 d = self.root.callRemote( | |
481 "menuLaunch", menu_type, path, data, security_limit, profile_key | |
482 ) | |
483 if callback is not None: | 371 if callback is not None: |
484 d.addCallback(callback) | 372 d.addCallback(callback) |
485 if errback is None: | 373 if errback is None: |
486 errback = self._generic_errback | 374 errback = self._generic_errback |
487 d.addErrback(errback) | 375 d.addErrback(errback) |
492 d.addCallback(callback) | 380 d.addCallback(callback) |
493 if errback is None: | 381 if errback is None: |
494 errback = self._generic_errback | 382 errback = self._generic_errback |
495 d.addErrback(errback) | 383 d.addErrback(errback) |
496 | 384 |
497 def messageSend( | 385 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None): |
498 self, | 386 d = self.root.callRemote("messageSend", to_jid, message, subject, mess_type, extra, profile_key) |
499 to_jid, | |
500 message, | |
501 subject={}, | |
502 mess_type="auto", | |
503 extra={}, | |
504 profile_key="@NONE@", | |
505 callback=None, | |
506 errback=None, | |
507 ): | |
508 d = self.root.callRemote( | |
509 "messageSend", to_jid, message, subject, mess_type, extra, profile_key | |
510 ) | |
511 if callback is not None: | 387 if callback is not None: |
512 d.addCallback(lambda dummy: callback()) | 388 d.addCallback(lambda dummy: callback()) |
513 if errback is None: | 389 if errback is None: |
514 errback = self._generic_errback | 390 errback = self._generic_errback |
515 d.addErrback(errback) | 391 d.addErrback(errback) |
520 d.addCallback(callback) | 396 d.addCallback(callback) |
521 if errback is None: | 397 if errback is None: |
522 errback = self._generic_errback | 398 errback = self._generic_errback |
523 d.addErrback(errback) | 399 d.addErrback(errback) |
524 | 400 |
525 def paramsRegisterApp( | 401 def paramsRegisterApp(self, xml, security_limit=-1, app='', callback=None, errback=None): |
526 self, xml, security_limit=-1, app="", callback=None, errback=None | |
527 ): | |
528 d = self.root.callRemote("paramsRegisterApp", xml, security_limit, app) | 402 d = self.root.callRemote("paramsRegisterApp", xml, security_limit, app) |
529 if callback is not None: | 403 if callback is not None: |
530 d.addCallback(lambda dummy: callback()) | 404 d.addCallback(lambda dummy: callback()) |
531 if errback is None: | 405 if errback is None: |
532 errback = self._generic_errback | 406 errback = self._generic_errback |
533 d.addErrback(errback) | 407 d.addErrback(errback) |
534 | 408 |
535 def profileCreate( | 409 def profileCreate(self, profile, password='', component='', callback=None, errback=None): |
536 self, profile, password="", component="", callback=None, errback=None | |
537 ): | |
538 d = self.root.callRemote("profileCreate", profile, password, component) | 410 d = self.root.callRemote("profileCreate", profile, password, component) |
539 if callback is not None: | 411 if callback is not None: |
540 d.addCallback(lambda dummy: callback()) | 412 d.addCallback(lambda dummy: callback()) |
541 if errback is None: | 413 if errback is None: |
542 errback = self._generic_errback | 414 errback = self._generic_errback |
543 d.addErrback(errback) | 415 d.addErrback(errback) |
544 | 416 |
545 def profileIsSessionStarted( | 417 def profileIsSessionStarted(self, profile_key="@DEFAULT@", callback=None, errback=None): |
546 self, profile_key="@DEFAULT@", callback=None, errback=None | |
547 ): | |
548 d = self.root.callRemote("profileIsSessionStarted", profile_key) | 418 d = self.root.callRemote("profileIsSessionStarted", profile_key) |
549 if callback is not None: | 419 if callback is not None: |
550 d.addCallback(callback) | 420 d.addCallback(callback) |
551 if errback is None: | 421 if errback is None: |
552 errback = self._generic_errback | 422 errback = self._generic_errback |
566 d.addCallback(lambda dummy: callback()) | 436 d.addCallback(lambda dummy: callback()) |
567 if errback is None: | 437 if errback is None: |
568 errback = self._generic_errback | 438 errback = self._generic_errback |
569 d.addErrback(errback) | 439 d.addErrback(errback) |
570 | 440 |
571 def profileStartSession( | 441 def profileStartSession(self, password='', profile_key="@DEFAULT@", callback=None, errback=None): |
572 self, password="", profile_key="@DEFAULT@", callback=None, errback=None | |
573 ): | |
574 d = self.root.callRemote("profileStartSession", password, profile_key) | 442 d = self.root.callRemote("profileStartSession", password, profile_key) |
575 if callback is not None: | 443 if callback is not None: |
576 d.addCallback(callback) | 444 d.addCallback(callback) |
577 if errback is None: | 445 if errback is None: |
578 errback = self._generic_errback | 446 errback = self._generic_errback |
579 d.addErrback(errback) | 447 d.addErrback(errback) |
580 | 448 |
581 def profilesListGet( | 449 def profilesListGet(self, clients=True, components=False, callback=None, errback=None): |
582 self, clients=True, components=False, callback=None, errback=None | |
583 ): | |
584 d = self.root.callRemote("profilesListGet", clients, components) | 450 d = self.root.callRemote("profilesListGet", clients, components) |
585 if callback is not None: | 451 if callback is not None: |
586 d.addCallback(callback) | 452 d.addCallback(callback) |
587 if errback is None: | 453 if errback is None: |
588 errback = self._generic_errback | 454 errback = self._generic_errback |
626 d.addCallback(callback) | 492 d.addCallback(callback) |
627 if errback is None: | 493 if errback is None: |
628 errback = self._generic_errback | 494 errback = self._generic_errback |
629 d.addErrback(errback) | 495 d.addErrback(errback) |
630 | 496 |
631 def setParam( | 497 def setParam(self, name, value, category, security_limit=-1, profile_key="@DEFAULT@", callback=None, errback=None): |
632 self, | 498 d = self.root.callRemote("setParam", name, value, category, security_limit, profile_key) |
633 name, | 499 if callback is not None: |
634 value, | 500 d.addCallback(lambda dummy: callback()) |
635 category, | 501 if errback is None: |
636 security_limit=-1, | 502 errback = self._generic_errback |
637 profile_key="@DEFAULT@", | 503 d.addErrback(errback) |
638 callback=None, | 504 |
639 errback=None, | 505 def setPresence(self, to_jid='', show='', statuses={}, profile_key="@DEFAULT@", callback=None, errback=None): |
640 ): | |
641 d = self.root.callRemote( | |
642 "setParam", name, value, category, security_limit, profile_key | |
643 ) | |
644 if callback is not None: | |
645 d.addCallback(lambda dummy: callback()) | |
646 if errback is None: | |
647 errback = self._generic_errback | |
648 d.addErrback(errback) | |
649 | |
650 def setPresence( | |
651 self, | |
652 to_jid="", | |
653 show="", | |
654 statuses={}, | |
655 profile_key="@DEFAULT@", | |
656 callback=None, | |
657 errback=None, | |
658 ): | |
659 d = self.root.callRemote("setPresence", to_jid, show, statuses, profile_key) | 506 d = self.root.callRemote("setPresence", to_jid, show, statuses, profile_key) |
660 if callback is not None: | 507 if callback is not None: |
661 d.addCallback(lambda dummy: callback()) | 508 d.addCallback(lambda dummy: callback()) |
662 if errback is None: | 509 if errback is None: |
663 errback = self._generic_errback | 510 errback = self._generic_errback |
664 d.addErrback(errback) | 511 d.addErrback(errback) |
665 | 512 |
666 def subscription( | 513 def subscription(self, sub_type, entity, profile_key="@DEFAULT@", callback=None, errback=None): |
667 self, sub_type, entity, profile_key="@DEFAULT@", callback=None, errback=None | |
668 ): | |
669 d = self.root.callRemote("subscription", sub_type, entity, profile_key) | 514 d = self.root.callRemote("subscription", sub_type, entity, profile_key) |
670 if callback is not None: | 515 if callback is not None: |
671 d.addCallback(lambda dummy: callback()) | 516 d.addCallback(lambda dummy: callback()) |
672 if errback is None: | 517 if errback is None: |
673 errback = self._generic_errback | 518 errback = self._generic_errback |
674 d.addErrback(errback) | 519 d.addErrback(errback) |
675 | 520 |
676 def updateContact( | 521 def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@", callback=None, errback=None): |
677 self, | |
678 entity_jid, | |
679 name, | |
680 groups, | |
681 profile_key="@DEFAULT@", | |
682 callback=None, | |
683 errback=None, | |
684 ): | |
685 d = self.root.callRemote("updateContact", entity_jid, name, groups, profile_key) | 522 d = self.root.callRemote("updateContact", entity_jid, name, groups, profile_key) |
686 if callback is not None: | 523 if callback is not None: |
687 d.addCallback(lambda dummy: callback()) | 524 d.addCallback(lambda dummy: callback()) |
688 if errback is None: | 525 if errback is None: |
689 errback = self._generic_errback | 526 errback = self._generic_errback |