本文整理匯總了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"]: