本文整理汇总了Python中cloudmesh_client.common.Printer.Printer.dict_printer方法的典型用法代码示例。如果您正苦于以下问题:Python Printer.dict_printer方法的具体用法?Python Printer.dict_printer怎么用?Python Printer.dict_printer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloudmesh_client.common.Printer.Printer
的用法示例。
在下文中一共展示了Printer.dict_printer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: list
# 需要导入模块: from cloudmesh_client.common.Printer import Printer [as 别名]
# 或者: from cloudmesh_client.common.Printer.Printer import dict_printer [as 别名]
def list(cls,
category=None,
order=None,
output='table'):
"""
lists the default values in the specified format.
TODO: This method has a bug as it uses format and output,
only one should be used.
:param category: the category of the default value. If general is used
it is a special category that is used for global values.
:param order: The order in which the attributes are returned
:param output: The output format. json, table, yaml, dict, csv
:return:
"""
# if order is None:
# # (order, header) = CloudProvider(category).get_attributes("default")
try:
if category is None:
d = cls.cm.all("default")
else:
d = cls.cm.find('default', category=category)
return (Printer.dict_printer(d,
order=order,
output=output))
except:
return None