jp (debug/bridge): fixed unicode handling of arguments

This commit is contained in:
Goffi 2016-08-21 18:57:56 +02:00
commit 371dd6134c

View file

@ -35,7 +35,7 @@ class BridgeCommon(object):
except SyntaxError as e:
self.disp(u"Can't evaluate arguments: {mess}\n{text}\n{offset}^".format(
mess=e,
text=e.text,
text=e.text.decode('utf-8'),
offset=u" "*(e.offset-1)
), error=True)
self.host.quit(C.EXIT_BAD_ARG)
@ -52,7 +52,7 @@ class Method(base.CommandBase, BridgeCommon):
def add_parser_options(self):
self.parser.add_argument("method", type=str, help=_(u"name of the method to execute"))
self.parser.add_argument("arg", nargs="*", help=_(u"argument of the method"))
self.parser.add_argument("arg", type=base.unicode_decoder, nargs="*", help=_(u"argument of the method"))
def method_cb(self, ret):
self.disp(unicode(ret))
@ -83,7 +83,7 @@ class Signal(base.CommandBase, BridgeCommon):
def add_parser_options(self):
self.parser.add_argument("signal", type=str, help=_(u"name of the signal to send"))
self.parser.add_argument("arg", nargs="*", help=_(u"argument of the signal"))
self.parser.add_argument("arg", type=base.unicode_decoder, nargs="*", help=_(u"argument of the signal"))
def start(self):
args = self.evalArgs()