aboutsummaryrefslogtreecommitdiffstats
path: root/be
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2005-03-09 19:32:17 +0000
committerAaron Bentley <abentley@panoramicfeedback.com>2005-03-09 19:32:17 +0000
commit006b0cb118041cac8081032ad2d401fdd69fe6ae (patch)
treee8dd9b0d65d0ce3ca842cd279ba3edc724416e8e /be
parent6ade356915dc78cae448b8b48028659ee0528244 (diff)
downloadbugseverywhere-006b0cb118041cac8081032ad2d401fdd69fe6ae.tar.gz
Added ability to create, close, open bugs
Diffstat (limited to 'be')
-rwxr-xr-xbe32
1 files changed, 27 insertions, 5 deletions
diff --git a/be b/be
index 11e8c5c..47eec40 100755
--- a/be
+++ b/be
@@ -8,21 +8,22 @@ be set-root: assign the root directory for bug tracking
"""
from libbe.cmdutil import *
from libbe.bugdir import tree_root
+from libbe import names
import sys
import os
def list_bugs(args):
active = True
- status = ("minor", "serious", "critical", "fatal")
+ severity = ("minor", "serious", "critical", "fatal")
def filter(bug):
if active is not None:
if bug.active != active:
return False
- if bug.status not in status:
+ if bug.severity not in severity:
return False
return True
- bugs = [b for b in tree_root(os.getcwd()).list() ]
+ bugs = [b for b in tree_root(os.getcwd()).list() if filter(b) ]
if len(bugs) == 0:
print "No matching bugs found"
for bug in bugs:
@@ -34,7 +35,25 @@ def list_bugs(args):
print "id: %s severity: %s%s\n%s\n" % (unique_name(bug, bugs),
bug.severity, target, bug.summary)
-
+def new_bug(args):
+ if len(args) != 1:
+ raise UserError("Please supply a summary message")
+ dir = tree_root(".")
+ bugs = (dir.list())
+ bug = dir.new_bug()
+ bug.creator = names.creator()
+ bug.name = names.friendly_name(bugs, bug.creator)
+ bug.severity = "minor"
+ bug.status = "open"
+ bug.summary = args[0]
+
+def close_bug(args):
+ assert(len(args) == 1)
+ get_bug(args[0], tree_root('.')).status = "closed"
+
+def open_bug(args):
+ assert(len(args) == 1)
+ get_bug(args[0], tree_root('.')).status = "open"
if len(sys.argv) == 1:
print __doc__
@@ -42,7 +61,10 @@ else:
try:
try:
cmd = {
- "list": list_bugs
+ "list": list_bugs,
+ "new": new_bug,
+ "close": close_bug,
+ "open": open_bug,
}[sys.argv[1]]
except KeyError, e:
raise UserError("Unknown command \"%s\"" % e.args[0])