# HG changeset patch # User Goffi # Date 1447981036 -3600 # Node ID 2071d5cec5d61fcd43e904354f908ef7979159d6 # Parent 4f9fa67758ebf6e02cece12bc54172ab3ce50ac5 quick frontend: added progressIdHandler to managed progress id on action result + ignore meta_* action results diff -r 4f9fa67758eb -r 2071d5cec5d6 frontends/src/quick_frontend/quick_app.py --- 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())))