Mercurial > libervia-backend
comparison frontends/src/jp/cmd_file.py @ 1621:a17a91531fbe
jp (file): print a message and quit if progress_id is not received
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 17 Nov 2015 20:18:51 +0100 |
parents | de785fcf9a7b |
children | 5a641e7b858a |
comparison
equal
deleted
inserted
replaced
1620:4dd07d026214 | 1621:a17a91531fbe |
---|---|
57 @param pid(unicode): progress id | 57 @param pid(unicode): progress id |
58 @param file_(str): file path | 58 @param file_(str): file path |
59 """ | 59 """ |
60 #FIXME: this show progress only for last progress_id | 60 #FIXME: this show progress only for last progress_id |
61 self.disp(_(u"File request sent to {jid}".format(jid=self.full_dest_jid)), 1) | 61 self.disp(_(u"File request sent to {jid}".format(jid=self.full_dest_jid)), 1) |
62 self.progress_id = data['progress'] | 62 try: |
63 self.progress_id = data['progress'] | |
64 except KeyError: | |
65 # TODO: if 'xmlui' key is present, manage xmlui message display | |
66 self.disp(_(u"Can't send file to {jid}".format(jid=self.full_dest_jid)), error=True) | |
67 self.host.quit(2) | |
63 | 68 |
64 def error(self, failure): | 69 def error(self, failure): |
65 self.disp(_("Error while trying to send a file: {reason}").format(reason=failure), error=True) | 70 self.disp(_("Error while trying to send a file: {reason}").format(reason=failure), error=True) |
66 self.host.quit(1) | 71 self.host.quit(1) |
67 | 72 |