comparison frontends/src/bridge/DBus.py @ 1522:7d7e57a84792

core: progression handling improvments: - getProgress has been renamed to progressGet to follown new naming convention - new signals: progressStarted, progressFinished and progressError to indicate state of progressing events - new method progressGetAll to get all progressing events of all profile (or only one profile)
author Goffi <goffi@goffi.org>
date Fri, 25 Sep 2015 19:19:12 +0200
parents 80cd55dd5b04
children 42285d993e68
comparison
equal deleted inserted replaced
1521:d2ab9c62ac3a 1522:7d7e57a84792
448 kwargs['timeout'] = const_TIMEOUT 448 kwargs['timeout'] = const_TIMEOUT
449 kwargs['reply_handler'] = callback 449 kwargs['reply_handler'] = callback
450 kwargs['error_handler'] = error_handler 450 kwargs['error_handler'] = error_handler
451 return self.db_core_iface.getProfilesList(**kwargs) 451 return self.db_core_iface.getProfilesList(**kwargs)
452 452
453 def getProgress(self, id, profile, callback=None, errback=None):
454 if callback is None:
455 error_handler = None
456 else:
457 if errback is None:
458 errback = log.error
459 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
460 kwargs={}
461 if callback is not None:
462 kwargs['timeout'] = const_TIMEOUT
463 kwargs['reply_handler'] = callback
464 kwargs['error_handler'] = error_handler
465 return self.db_core_iface.getProgress(id, profile, **kwargs)
466
467 def getReady(self, callback=None, errback=None): 453 def getReady(self, callback=None, errback=None):
468 if callback is None: 454 if callback is None:
469 error_handler = None 455 error_handler = None
470 else: 456 else:
471 if errback is None: 457 if errback is None:
564 kwargs['timeout'] = const_TIMEOUT 550 kwargs['timeout'] = const_TIMEOUT
565 kwargs['reply_handler'] = callback 551 kwargs['reply_handler'] = callback
566 kwargs['error_handler'] = error_handler 552 kwargs['error_handler'] = error_handler
567 return self.db_core_iface.paramsRegisterApp(xml, security_limit, app, **kwargs) 553 return self.db_core_iface.paramsRegisterApp(xml, security_limit, app, **kwargs)
568 554
555 def progressGet(self, id, profile, callback=None, errback=None):
556 if callback is None:
557 error_handler = None
558 else:
559 if errback is None:
560 errback = log.error
561 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
562 kwargs={}
563 if callback is not None:
564 kwargs['timeout'] = const_TIMEOUT
565 kwargs['reply_handler'] = callback
566 kwargs['error_handler'] = error_handler
567 return self.db_core_iface.progressGet(id, profile, **kwargs)
568
569 def progressGetAll(self, profile, callback=None, errback=None):
570 if callback is None:
571 error_handler = None
572 else:
573 if errback is None:
574 errback = log.error
575 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
576 kwargs={}
577 if callback is not None:
578 kwargs['timeout'] = const_TIMEOUT
579 kwargs['reply_handler'] = callback
580 kwargs['error_handler'] = error_handler
581 return self.db_core_iface.progressGetAll(profile, **kwargs)
582
569 def saveParamsTemplate(self, filename, callback=None, errback=None): 583 def saveParamsTemplate(self, filename, callback=None, errback=None):
570 if callback is None: 584 if callback is None:
571 error_handler = None 585 error_handler = None
572 else: 586 else:
573 if errback is None: 587 if errback is None: