Mercurial > libervia-backend
diff sat_frontends/jp/cmd_uri.py @ 2624:56f94936df1e
code style reformatting using black
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 27 Jun 2018 20:14:46 +0200 |
parents | 26edcf3a30eb |
children | 003b8b4b56a7 |
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_uri.py Wed Jun 27 07:51:29 2018 +0200 +++ b/sat_frontends/jp/cmd_uri.py Wed Jun 27 20:14:46 2018 +0200 @@ -27,33 +27,44 @@ class Parse(base.CommandBase): - def __init__(self, host): - base.CommandBase.__init__(self, host, 'parse', use_profile=False, use_output=C.OUTPUT_DICT, help=_(u'parse URI')) + base.CommandBase.__init__( + self, + host, + "parse", + use_profile=False, + use_output=C.OUTPUT_DICT, + help=_(u"parse URI"), + ) def add_parser_options(self): - self.parser.add_argument("uri", type=base.unicode_decoder, help=_(u"XMPP URI to parse")) + self.parser.add_argument( + "uri", type=base.unicode_decoder, help=_(u"XMPP URI to parse") + ) def start(self): self.output(uri.parseXMPPUri(self.args.uri)) class Build(base.CommandBase): - def __init__(self, host): - base.CommandBase.__init__(self, host, 'build', use_profile=False, help=_(u'build URI')) + base.CommandBase.__init__( + self, host, "build", use_profile=False, help=_(u"build URI") + ) def add_parser_options(self): self.parser.add_argument("type", type=base.unicode_decoder, help=_(u"URI type")) self.parser.add_argument("path", type=base.unicode_decoder, help=_(u"URI path")) - self.parser.add_argument("-f", + self.parser.add_argument( + "-f", "--field", type=base.unicode_decoder, - action='append', + action="append", nargs=2, - dest='fields', + dest="fields", metavar=(u"KEY", u"VALUE"), - help=_(u"URI fields")) + help=_(u"URI fields"), + ) def start(self): fields = dict(self.args.fields) if self.args.fields else {} @@ -64,4 +75,6 @@ subcommands = (Parse, Build) def __init__(self, host): - super(Uri, self).__init__(host, 'uri', use_profile=False, help=_('XMPP URI parsing/generation')) + super(Uri, self).__init__( + host, "uri", use_profile=False, help=_("XMPP URI parsing/generation") + )