Mercurial > libervia-backend
changeset 1633:2071d5cec5d6
quick frontend: added progressIdHandler to managed progress id on action result + ignore meta_* action results
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 20 Nov 2015 01:57:16 +0100 |
parents | 4f9fa67758eb |
children | 95ea323e7d04 |
files | frontends/src/quick_frontend/quick_app.py |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py Thu Nov 19 22:31:06 2015 +0100 +++ b/frontends/src/quick_frontend/quick_app.py Fri Nov 20 01:57:16 2015 +0100 @@ -675,6 +675,10 @@ def dialogFailure(self, failure): log.warning(u"Failure: {}".format(failure)) + def progressIdHandler(self, progress_id, profile): + """Callback used when an action result in a progress id""" + log.info(u"Progress ID received: {}".format(progress_id)) + def updateAlertsCounter(self): """Update the over whole alerts counter @@ -722,6 +726,17 @@ else: ui = self.xmlui.create(self, xml_data=xmlui, callback=callback, profile=profile) ui.show() + + try: + progress_id = action_data.pop('progress') + except KeyError: + pass + else: + self.progressIdHandler(progress_id, profile) + + # we ignore metadata + action_data = {k:v for k,v in action_data.iteritems() if not k.startswith("meta_")} + if action_data: raise exceptions.DataError(u"Not all keys in action_data are managed ({keys})".format(keys=', '.join(action_data.keys())))