calculates interesting information about them.
Its subcommands are:
- count-exists Counts how many autoinstalls contain a file
- list Prints the locations of all autoinstalls
- list-errors Prints all errors that occurred during parsing
version Breakdown of autoinstalls by version (default)
Use %prog summary SUBCOMMAND --help for more information."""
parser.error("invalid action")
command_module.main(rest_argv, baton)
-## -- some generic helper stuff --
-
-def parse_install_lines(show, options, yield_errors = False):
- if not show: show = deploy.applications()
- show = frozenset(show)
- for line in deploy.getInstallLines(options.versions_path):
- # construction
- try:
- d = deploy.Deployment.parse(line)
- name = d.application.name
- except deploy.NoSuchApplication as e:
- if yield_errors:
- yield e
- continue
- except deploy.Error:
- # we consider this a worse error
- logging.warning("Error with '%s'" % line.rstrip())
- continue
- # filter
- if name + "-" + str(d.version) in show or name in show:
- pass
- else:
- continue
- # yield
- yield d
-
-class Counter(object):
- def __init__(self):
- self.dict = {}
- def count(self, value):
- self.dict.setdefault(value, 0)
- self.dict[value] += 1
- def __getitem__(self, key):
- return self.dict[key]
- def __iter__(self):
- return self.dict.__iter__()
-