本文整理汇总了Python中pybombs.commands.CommandBase类的典型用法代码示例。如果您正苦于以下问题:Python CommandBase类的具体用法?Python CommandBase怎么用?Python CommandBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommandBase类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, cmd, args):
CommandBase.__init__(
self,
cmd, args,
load_recipes=False,
require_prefix=True,
)
示例2: __init__
def __init__(self, cmd, args):
CommandBase.__init__(self, cmd, args, require_prefix=True)
verb = "Showing" if self.args.value is None else "Setting"
if self.args.key is None:
print("{verb} package state:".format(verb=verb))
else:
print("{verb} value for key `{key}':".format(verb=verb, key=self.args.key))
示例3: __init__
def __init__(self, cmd, args):
CommandBase.__init__(self,
cmd, args,
load_recipes=True,
require_prefix=True,
)
self.pm = packagers.source.Source()
self.args.packages = args.packages[0]
if len(self.args.packages) == 0:
self.args.packages = self.inventory.get_packages()
示例4: __init__
def __init__(self, cmd, args):
CommandBase.__init__(
self,
cmd, args,
load_recipes=False,
require_prefix=False,
)
# Figure out which config file to write to
self.cfg_file = self.get_cfg_file(args)
self.log.info("Using config file: {0}".format(self.cfg_file))
示例5: __init__
def __init__(self, cmd, args):
CommandBase.__init__(self,
cmd, args,
load_recipes=True,
require_prefix=True,
)
Requirer.__init__(self)
self.packages = []
if self.args.all:
self.packages = recipe_manager.recipe_manager.list_all()
else:
self.packages = self.inventory.get_packages()
示例6: __init__
def __init__(self, cmd, args):
CommandBase.__init__(
self,
cmd, args,
load_recipes=True,
require_prefix=True,
)
self.args.packages = args.packages[0]
if len(self.args.packages) == 0 and not args.all:
self.log.error("No packages specified.")
exit(1)
if self.args.all:
self.args.deps = False
示例7: __init__
def __init__(self, cmd, args):
CommandBase.__init__(self,
cmd, args,
load_recipes=False,
require_prefix=False,
)
# Figure out which config file to write to
self.cfg_file = self.cfg.local_cfg
prefix = self.cfg.get_active_prefix()
if self.args.config_file is not None:
self.cfg_file = self.args.config_file
elif prefix.prefix_dir is not None and prefix.prefix_src == "cli":
self.cfg_file = prefix.cfg_file
self.log.info("Using config file: {0}".format(self.cfg_file))
示例8: __init__
def __init__(self, cmd, args):
CommandBase.__init__(self,
cmd, args,
load_recipes=True,
require_prefix=False,
)
self.package_manager = package_manager.PackageManager()
if args.all:
self.args.packages = recipe_manager.list_all()
else:
self.args.packages = args.packages[0] # wat?
if len(self.args.packages) == 0:
self.log.error("No packages specified.")
exit(1)
示例9: __init__
def __init__(self, cmd, args):
CommandBase.__init__(self,
cmd, args,
load_recipes=False,
require_prefix=True,
)
self.args.packages = args.packages[0]
if len(self.args.packages) == 0:
self.log.error("No packages specified.")
exit(1)
# Do not allow any non-source packagers for this:
self.cfg.set('packagers', '')
self.pm = package_manager.PackageManager()
if not self.args.no_deps:
self.args.packages = self.get_dependees(self.args.packages)
示例10: __init__
def __init__(self, cmd, args):
CommandBase.__init__(self,
cmd, args,
load_recipes=True,
require_prefix=False, # Not required for non-source builds
)
self.args.packages = args.packages[0]
get_all_pkgs = False
if len(self.args.packages) == 0:
if cmd == 'update':
get_all_pkgs = True
if not self.args.all:
self.args.no_deps = True
else:
self.log.error("No packages specified.")
raise PBException("No packages specified.")
self.update_if_exists = (cmd == 'update' or self.args.update)
self.fail_if_not_exists = (cmd == 'update')
if get_all_pkgs:
self.args.packages = self.inventory.get_packages()
self.install_manager = install_manager.InstallManager()
示例11: __init__
def __init__(self, cmd, args):
CommandBase.__init__(self,
cmd, args,
load_recipes=True,
require_prefix=(args.prefix_command != 'init'),
)
示例12: __init__
def __init__(self, cmd, args):
CommandBase.__init__(self,
cmd, args,
require_prefix=False,
)