本文整理匯總了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()