本文整理汇总了Python中plan.Plan.resolve方法的典型用法代码示例。如果您正苦于以下问题:Python Plan.resolve方法的具体用法?Python Plan.resolve怎么用?Python Plan.resolve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plan.Plan
的用法示例。
在下文中一共展示了Plan.resolve方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StdTrap
# 需要导入模块: from plan import Plan [as 别名]
# 或者: from plan.Plan import resolve [as 别名]
for arg in args:
if arg == "-" or os.path.exists(arg):
subplan = Plan.init_from_file(arg, cpp_opts, pool_path)
plan |= subplan
for package in subplan:
plan.packageorigins.add(package, arg)
else:
plan.add(arg)
plan.packageorigins.add(arg, '_')
trap = StdTrap(stdout=(output_path is None), stderr=False)
try:
spec = plan.resolve()
finally:
trap.close()
if output_path is None:
trapped_output = trap.stdout.read()
print >> sys.stderr, trapped_output,
spec = annotate_spec(spec, plan.packageorigins)
if output_path is None:
print spec
else:
open(output_path, "w").write(str(spec) + "\n")
if __name__=="__main__":
示例2: fatal
# 需要导入模块: from plan import Plan [as 别名]
# 或者: from plan.Plan import resolve [as 别名]
if pool_path and not resolve_deps:
fatal("--no-deps cannot be specified if pool is not defined")
if not arch:
arch = getoutput("dpkg --print-architecture")
plan = Plan(pool_path=pool_path)
for arg in args[1:]:
if arg == "-" or os.path.exists(arg):
plan |= Plan.init_from_file(arg, cpp_opts, pool_path)
else:
plan.add(arg)
if pool_path:
if resolve_deps:
packages = list(plan.resolve())
else:
packages = list(plan)
installer = PoolInstaller(chroot_path, pool_path, arch, environ)
else:
packages = list(plan)
installer = LiveInstaller(chroot_path, apt_proxy, environ)
installer.install(packages, ignore_errors)
if __name__=="__main__":
main()