# HG changeset patch # User Goffi # Date 1513033887 -3600 # Node ID 49aa1e3a90b8d9119720803abafbdf25db733880 # Parent 83f9b9ff1a54193f9a19e0d04be69376ce2090a8 jp (base): added exitCb generic callback to display a message and quit diff -r 83f9b9ff1a54 -r 49aa1e3a90b8 frontends/src/jp/base.py --- a/frontends/src/jp/base.py Tue Dec 12 00:09:39 2017 +0100 +++ b/frontends/src/jp/base.py Tue Dec 12 00:11:27 2017 +0100 @@ -779,6 +779,16 @@ raise exceptions.InternalError(_(u'trying to use output when use_output has not been set')) return self.host.output(output_type, self.args.output, self.extra_outputs, data) + def exitCb(self, msg=None): + """generic callback for success + + optionally print a message, and quit + msg(None, unicode): if not None, print this message + """ + if msg is not None: + self.disp(msg) + self.host.quit(C.EXIT_OK) + def errback(self, failure_, msg=None, exit_code=C.EXIT_ERROR): """generic callback for errbacks