aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/cmdutil.py
diff options
context:
space:
mode:
authorAaron Bentley <abentley@panoramicfeedback.com>2005-03-11 17:45:05 +0000
committerAaron Bentley <abentley@panoramicfeedback.com>2005-03-11 17:45:05 +0000
commitf5458611072ab7c6048311430771d1ec297d4f61 (patch)
tree0f3c8787b0063a6d78a347e6b3f5276f3a5f4513 /libbe/cmdutil.py
parent56c2c54ef00acc75f2bce8ded2b7fa66e8d07712 (diff)
downloadbugseverywhere-f5458611072ab7c6048311430771d1ec297d4f61.tar.gz
Added severity command
Diffstat (limited to 'libbe/cmdutil.py')
-rw-r--r--libbe/cmdutil.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/libbe/cmdutil.py b/libbe/cmdutil.py
index ac67f3a..2afd53c 100644
--- a/libbe/cmdutil.py
+++ b/libbe/cmdutil.py
@@ -1,3 +1,4 @@
+import bugdir
def unique_name(bug, bugs):
chars = 1
for some_bug in bugs:
@@ -11,8 +12,18 @@ class UserError(Exception):
def __init__(self, msg):
Exception.__init__(self, msg)
-def get_bug(spec, bug_dir):
+class UserErrorWrap(UserError):
+ def __init__(self, exception):
+ UserError.__init__(self, str(exception))
+ self.exception = exception
+
+def get_bug(spec, bug_dir=None):
matches = []
+ try:
+ if bug_dir is None:
+ bug_dir = bugdir.tree_root('.')
+ except bugdir.NoBugDir, e:
+ raise UserErrorWrap(e)
bugs = list(bug_dir.list())
for bug in bugs:
if bug.uuid.startswith(spec):