本文整理汇总了Python中Command.Command.add_argument方法的典型用法代码示例。如果您正苦于以下问题:Python Command.add_argument方法的具体用法?Python Command.add_argument怎么用?Python Command.add_argument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command.Command
的用法示例。
在下文中一共展示了Command.add_argument方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from Command import Command [as 别名]
# 或者: from Command.Command import add_argument [as 别名]
def execute(executor, *args, **kwargs):
ls_command = Command('ls')
for arg in args:
ls_command.add_argument(arg)
ls = type(executor)(reference=executor)
ls.add_command(ls_command)
return ls()
示例2: Command
# 需要导入模块: from Command import Command [as 别名]
# 或者: from Command.Command import add_argument [as 别名]
__author__ = 'wenychan'
from Command import Command
from LocalExecutor import LocalExec
from RemoteExecutor import RemoteExec
command = Command('echo')
command.add_argument('${text}')
dict = {}
dict['text'] = 'aaaaaaaa'
command.set_substitution_dict(dict)
command1 = Command('ls -a')
command2 = Command('echo')
command2.add_argument('${text}')
dict = {}
dict['text'] = 'bbbbbbbbbbb'
command2.set_substitution_dict(dict)
ins = LocalExec(command)
ins.add_command(command1)
ins.insert_command_at(1, command2)
# ins.show_commands()
ins.add_command("python aaa.py")
print
print
ins2 = LocalExec([command1, command2])
# ins2.show_commands()
print