本文整理汇总了Python中cloudmesh_client.common.Printer.Printer.dict_table方法的典型用法代码示例。如果您正苦于以下问题:Python Printer.dict_table方法的具体用法?Python Printer.dict_table怎么用?Python Printer.dict_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloudmesh_client.common.Printer.Printer
的用法示例。
在下文中一共展示了Printer.dict_table方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_launcher
# 需要导入模块: from cloudmesh_client.common.Printer import Printer [as 别名]
# 或者: from cloudmesh_client.common.Printer.Printer import dict_table [as 别名]
def do_launcher(self, args, arguments):
"""
::
Usage:
launcher repo add NAME URL
launcher repo delete NAME
launcher repo list
launcher repo
launcher list [NAMES] [--cloud=CLOUD] [--format=FORMAT] [--source=db|dir]
launcher add NAME SOURCE
launcher delete [NAMES] [--cloud=CLOUD]
launcher clear
launcher run [NAME]
launcher resume [NAME]
launcher suspend [NAME]
launcher refresh
launcher log [NAME]
launcher status [NAME]
Arguments:
KEY the name of the launcher
Options:
--cloud=CLOUD the name of the cloud
--format=FORMAT the output format [launcher: table]
--all lists all the launcher values
Description:
Launcher is a command line tool to test the portal launch
functionalities through command line.
The current launcher values can by listed with --all option:(
if you have a launcher cloud specified. You can also add a
cloud parameter to apply the command to a specific cloud)
launcher list
A launcher can be deleted with
launcher delete KEY
Examples:
launcher list --all
launcher list --cloud=general
launcher delete <KEY>
"""
print ("AAA")
arg = dotdict(arguments)
if arg.NAMES is not None:
arg.names = Parameter.expand(arg.NAMES)
else:
arg.names = None
if arg.name == ["all"]:
arg.names = None
arg.cloud = arguments["--cloud"] or Default.cloud
arg.output = arguments['--format'] or 'table'
arg.source = arguments['--source'] or 'db'
print ("BBB")
pprint(arg)
# arg.cloud = arguments["--cloud"] or Default.cloud
# c = arg.list
# print ("Hallo {cloud} is list={list}".format(**arg))
# launcher = Launcher(kind=None)
if arg.cloud is None:
Console.error("Default arg.cloud not set")
return
result = ""
if arguments["repo"] and arguments["list"]:
print("repo list")
launchers = ConfigDict(filename="cm_launcher.yaml")["cloudmesh"]["repo"]
print("repo add")
d = {}
for name in launchers:
location = launchers[name]["location"]
d[name] = {"name": name,
"location": location}
print (Printer.dict_table(d))
return ""
elif arguments["repo"] and arguments["add"]:
launchers = ConfigDict(filename="cm_launcher.yaml")
print("repo add")
print(launchers)
return ""
elif arguments["repo"] and arguments["delete"]:
print("repo delete")
return ""
#.........这里部分代码省略.........