2 from libbe.cmdutil import *
3 from libbe.bugdir import tree_root, create_bug_dir
4 from libbe import names
8 import commands.severity
9 __doc__ = """Bugs Everywhere - Distributed bug tracking
12 set-root: assign the root directory for bug tracking
15 show: show a particular bug
20 Unimplemented commands
21 comment: append a comment to a bug
22 """ % commands.severity.__desc__
26 severity = ("minor", "serious", "critical", "fatal")
28 if active is not None:
29 if bug.active != active:
31 if bug.severity not in severity:
34 all_bugs = list(tree_root(os.getcwd()).list())
35 bugs = [b for b in all_bugs if filter(b) ]
37 print "No matching bugs found"
39 print bug_summary(bug, all_bugs)
42 bug_dir = tree_root(os.getcwd())
44 raise UserError("Please specify a bug id.")
45 print bug_summary(get_bug(args[0], bug_dir), list(bug_dir.list()))
49 raise UserError("Please supply a directory path")
50 create_bug_dir(args[0])
54 raise UserError("Please supply a summary message")
58 bug.creator = names.creator()
59 bug.severity = "minor"
64 assert(len(args) == 1)
65 get_bug(args[0], tree_root('.')).status = "closed"
68 assert(len(args) == 1)
69 get_bug(args[0], tree_root('.')).status = "open"
71 if len(sys.argv) == 1:
83 "severity": commands.severity.execute,
86 raise UserError("Unknown command \"%s\"" % e.args[0])