comparison frontends/src/jp/cmd_debug.py @ 2053:a3c2866841f7

jp (debug): method callback now handles methods without return value
author Goffi <goffi@goffi.org>
date Sun, 28 Aug 2016 20:10:04 +0200
parents 456abbceee19
children 741db5abf077
comparison
equal deleted inserted replaced
2052:d44efd32bc2f 2053:a3c2866841f7
52 52
53 def add_parser_options(self): 53 def add_parser_options(self):
54 self.parser.add_argument("method", type=str, help=_(u"name of the method to execute")) 54 self.parser.add_argument("method", type=str, help=_(u"name of the method to execute"))
55 self.parser.add_argument("arg", type=base.unicode_decoder, nargs="*", help=_(u"argument of the method")) 55 self.parser.add_argument("arg", type=base.unicode_decoder, nargs="*", help=_(u"argument of the method"))
56 56
57 def method_cb(self, ret): 57 def method_cb(self, ret=None):
58 self.disp(unicode(ret)) 58 if ret is not None:
59 self.disp(unicode(ret))
59 self.host.quit() 60 self.host.quit()
60 61
61 def method_eb(self, failure): 62 def method_eb(self, failure):
62 self.disp(_(u"Error while executing {}: {}".format(self.args.method, failure)), error=True) 63 self.disp(_(u"Error while executing {}: {}".format(self.args.method, failure)), error=True)
63 self.host.quit(C.EXIT_ERROR) 64 self.host.quit(C.EXIT_ERROR)