Mercurial > libervia-backend
comparison frontends/src/jp/cmd_adhoc.py @ 2411:f9167c053475
jp (ad-hoc/run): node is now a positional argument
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 31 Oct 2017 23:30:18 +0100 |
parents | d2ff5ff3de77 |
children | 8b37a62336c3 |
comparison
equal
deleted
inserted
replaced
2410:40e6e779a253 | 2411:f9167c053475 |
---|---|
70 def __init__(self, host): | 70 def __init__(self, host): |
71 super(Run, self).__init__(host, 'run', use_verbose=True, help=_(u'run an Ad-Hoc command')) | 71 super(Run, self).__init__(host, 'run', use_verbose=True, help=_(u'run an Ad-Hoc command')) |
72 self.need_loop=True | 72 self.need_loop=True |
73 | 73 |
74 def add_parser_options(self): | 74 def add_parser_options(self): |
75 self.parser.add_argument('-n', '--node', type=base.unicode_decoder, default=u'', help=_(u"node of the command (default: list commands)")) | |
76 self.parser.add_argument('-j', '--jid', type=base.unicode_decoder, default=u'', help=_(u"jid of the service (default: profile's server")) | 75 self.parser.add_argument('-j', '--jid', type=base.unicode_decoder, default=u'', help=_(u"jid of the service (default: profile's server")) |
77 self.parser.add_argument("-S", "--submit", action='append_const', const=xmlui_manager.SUBMIT, dest='workflow', help=_(u"submit form/page")) | 76 self.parser.add_argument("-S", "--submit", action='append_const', const=xmlui_manager.SUBMIT, dest='workflow', help=_(u"submit form/page")) |
78 self.parser.add_argument("-f", | 77 self.parser.add_argument("-f", |
79 "--field", | 78 "--field", |
80 type=base.unicode_decoder, | 79 type=base.unicode_decoder, |
81 action='append', | 80 action='append', |
82 nargs=2, | 81 nargs=2, |
83 dest='workflow', | 82 dest='workflow', |
84 metavar=(u"KEY", u"VALUE"), | 83 metavar=(u"KEY", u"VALUE"), |
85 help=_(u"field value")) | 84 help=_(u"field value")) |
85 self.parser.add_argument('node', type=base.unicode_decoder, nargs='?', default=u'', help=_(u"node of the command (default: list commands)")) | |
86 | 86 |
87 def adHocRunCb(self, xmlui_raw): | 87 def adHocRunCb(self, xmlui_raw): |
88 xmlui = xmlui_manager.create(self.host, xmlui_raw) | 88 xmlui = xmlui_manager.create(self.host, xmlui_raw) |
89 workflow = self.args.workflow | 89 workflow = self.args.workflow |
90 xmlui.show(workflow) | 90 xmlui.show(workflow) |