]> scripts.mit.edu Git - wizard.git/blob - wizard/command/summary/list_errors.py
ce974dd1a290d837883e9946b9c879c33f40ba74
[wizard.git] / wizard / command / summary / list_errors.py
1 import logging
2
3 from wizard import deploy
4 from wizard.command import _command
5 from wizard.command.summary import _summary
6
7 def main(argv, baton):
8     options, show = parse_args(argv, baton)
9     for e in _summary.parse_install_lines(show, options, True):
10         if not isinstance(e, deploy.Error):
11             if isinstance(e, Exception):
12                 raise e
13             continue
14         if options.verbose:
15             print e
16         else:
17             print e.location
18
19 def parse_args(argv, baton):
20     usage = """usage: %prog summary list-errors [ARGS]
21
22 Lists all errors that occurred while parsing the versions
23 directory."""
24     parser = _command.WizardOptionParser(usage)
25     baton.push(parser, "versions_path")
26     options, args = parser.parse_all(argv)
27     if len(args) > 1:
28         parser.error("too many arguments")
29     return options, args
30