本文整理汇总了Python中plan.Plan.from_file方法的典型用法代码示例。如果您正苦于以下问题:Python Plan.from_file方法的具体用法?Python Plan.from_file怎么用?Python Plan.from_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plan.Plan
的用法示例。
在下文中一共展示了Plan.from_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: from_plan
# 需要导入模块: from plan import Plan [as 别名]
# 或者: from plan.Plan import from_file [as 别名]
def from_plan(cls, planfile, config='config'):
plan = Plan.from_file(planfile)
pp = PlanProcessor(plan, config)
return pp.process_plan()
示例2: setup_logging
# 需要导入模块: from plan import Plan [as 别名]
# 或者: from plan.Plan import from_file [as 别名]
console_handler = logging.StreamHandler(sys.stderr)
console_handler.setFormatter(logging.Formatter())
console_handler.setLevel(logging.INFO)
root_logger = logging.getLogger()
root_logger.addHandler(console_handler)
root_logger.setLevel(logging.DEBUG)
if __name__ == "__main__":
setup_logging()
args = docopt(__doc__)
if args["load"]:
with open(args["<filename>"], 'r') as f:
pprint.pprint(load(f))
elif args["parse"]:
plan = Plan.from_file(args["<filename>"])
print plan
elif args["process"]:
assembly = Assembly.from_plan(args["<filename>"])
print assembly
elif args["generate"]:
assembly = Assembly.from_plan(args["<filename>"])
assembly.generate_files(os.path.split(args["<filename>"])[0], args["<output_folder>"])
elif args["generun"]:
assembly = Assembly.from_plan(args["<filename>"])
assembly.generate_files(os.path.split(args["<filename>"])[0], args["<output_folder>"])
os.chdir(os.path.join(args["<output_folder>"], assembly.plan.name))
client = Client(docker_url())
assembly.run(client)
elif args["start"]: