aboutsummaryrefslogtreecommitdiffstats
path: root/becommands
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-29 15:46:37 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-29 15:46:37 -0400
commit4e8882e74aad64859a16f17fa6bef8c04b33913d (patch)
tree26078e4fbc9a1176ed4e023e74c4bd7b6db1dcb5 /becommands
parentcaf0111d9c571ac268c235880e6d18fa512e9efa (diff)
downloadbugseverywhere-4e8882e74aad64859a16f17fa6bef8c04b33913d.tar.gz
Added clean messages on bug_from_shortname failure.
So user's don't get confused.
Diffstat (limited to 'becommands')
-rw-r--r--becommands/assign.py2
-rw-r--r--becommands/close.py2
-rw-r--r--becommands/comment.py6
-rw-r--r--becommands/depend.py4
-rw-r--r--becommands/merge.py4
-rw-r--r--becommands/open.py2
-rw-r--r--becommands/remove.py4
-rw-r--r--becommands/severity.py2
-rw-r--r--becommands/show.py2
-rw-r--r--becommands/status.py2
-rw-r--r--becommands/tag.py2
-rw-r--r--becommands/target.py2
12 files changed, 17 insertions, 17 deletions
diff --git a/becommands/assign.py b/becommands/assign.py
index 536bca6..81aac2b 100644
--- a/becommands/assign.py
+++ b/becommands/assign.py
@@ -54,7 +54,7 @@ def execute(args, test=False):
help()
raise cmdutil.UsageError("Too many arguments.")
bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 1:
bug.assigned = bd.user_id
elif len(args) == 2:
diff --git a/becommands/close.py b/becommands/close.py
index 0ba8f50..327817a 100644
--- a/becommands/close.py
+++ b/becommands/close.py
@@ -42,7 +42,7 @@ def execute(args, test=False):
if len(args) > 1:
raise cmdutil.UsageError("Too many arguments.")
bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
bug.status = "closed"
bd.save()
diff --git a/becommands/comment.py b/becommands/comment.py
index 55b5913..4221ef8 100644
--- a/becommands/comment.py
+++ b/becommands/comment.py
@@ -32,7 +32,7 @@ def execute(args, test=False):
>>> os.chdir(bd.root)
>>> execute(["a", "This is a comment about a"], test=True)
>>> bd._clear_bugs()
- >>> bug = bd.bug_from_shortname("a")
+ >>> bug = cmdutil.bug_from_shortname(bd, "a")
>>> bug.load_comments(load_full=False)
>>> comment = bug.comment_root[0]
>>> print comment.body
@@ -54,7 +54,7 @@ def execute(args, test=False):
>>> os.environ["EDITOR"] = "echo 'I like cheese' > "
>>> execute(["b"], test=True)
>>> bd._clear_bugs()
- >>> bug = bd.bug_from_shortname("b")
+ >>> bug = cmdutil.bug_from_shortname(bd, "b")
>>> bug.load_comments(load_full=False)
>>> comment = bug.comment_root[0]
>>> print comment.body
@@ -82,7 +82,7 @@ def execute(args, test=False):
bd = bugdir.BugDir(from_disk=True,
manipulate_encodings=not test)
- bug = bd.bug_from_shortname(bugname)
+ bug = cmdutil.bug_from_shortname(bd, bugname)
bug.load_comments(load_full=False)
if is_reply:
parent = bug.comment_root.comment_from_shortname(shortname,
diff --git a/becommands/depend.py b/becommands/depend.py
index 4a23b0f..d22ed2d 100644
--- a/becommands/depend.py
+++ b/becommands/depend.py
@@ -48,9 +48,9 @@ def execute(args, test=False):
raise cmdutil.UsageError("Too many arguments.")
bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
- bugA = bd.bug_from_shortname(args[0])
+ bugA = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 2:
- bugB = bd.bug_from_shortname(args[1])
+ bugB = cmdutil.bug_from_shortname(bd, args[1])
estrs = bugA.extra_strings
depend_string = "BLOCKED-BY:%s" % bugB.uuid
if options.remove == True:
diff --git a/becommands/merge.py b/becommands/merge.py
index 4aaefa8..633067c 100644
--- a/becommands/merge.py
+++ b/becommands/merge.py
@@ -134,9 +134,9 @@ def execute(args, test=False):
raise cmdutil.UsageError("Too many arguments.")
bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
- bugA = bd.bug_from_shortname(args[0])
+ bugA = cmdutil.bug_from_shortname(bd, args[0])
bugA.load_comments()
- bugB = bd.bug_from_shortname(args[1])
+ bugB = cmdutil.bug_from_shortname(bd, args[1])
bugB.load_comments()
mergeA = bugA.new_comment("Merged from bug %s" % bugB.uuid)
newCommTree = copy.deepcopy(bugB.comment_root)
diff --git a/becommands/open.py b/becommands/open.py
index 2ef5f43..242ceb2 100644
--- a/becommands/open.py
+++ b/becommands/open.py
@@ -41,7 +41,7 @@ def execute(args, test=False):
if len(args) > 1:
raise cmdutil.UsageError, "Too many arguments."
bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
bug.status = "open"
def get_parser():
diff --git a/becommands/remove.py b/becommands/remove.py
index d79a7be..7193119 100644
--- a/becommands/remove.py
+++ b/becommands/remove.py
@@ -30,7 +30,7 @@ def execute(args, test=False):
>>> bd._clear_bugs()
>>> try:
... bd.bug_from_shortname("b")
- ... except KeyError:
+ ... except bugdir.NoBugMatches:
... print "Bug not found"
Bug not found
"""
@@ -41,7 +41,7 @@ def execute(args, test=False):
if len(args) != 1:
raise cmdutil.UsageError, "Please specify a bug id."
bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
bd.remove_bug(bug)
print "Removed bug %s" % bug.uuid
diff --git a/becommands/severity.py b/becommands/severity.py
index 65467e3..74f241d 100644
--- a/becommands/severity.py
+++ b/becommands/severity.py
@@ -40,7 +40,7 @@ def execute(args, test=False):
if len(args) not in (1,2):
raise cmdutil.UsageError
bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 1:
print bug.severity
elif len(args) == 2:
diff --git a/becommands/show.py b/becommands/show.py
index e43cfb9..6c942fe 100644
--- a/becommands/show.py
+++ b/becommands/show.py
@@ -72,7 +72,7 @@ def execute(args, test=False):
is_comment = False
if is_comment == True and options.comments == False:
continue
- bug = bd.bug_from_shortname(bugname)
+ bug = cmdutil.bug_from_shortname(bd, bugname)
if is_comment == False:
if options.XML:
print bug.xml(show_comments=options.comments)
diff --git a/becommands/status.py b/becommands/status.py
index edc948d..bff0626 100644
--- a/becommands/status.py
+++ b/becommands/status.py
@@ -37,7 +37,7 @@ def execute(args, test=False):
if len(args) not in (1,2):
raise cmdutil.UsageError
bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 1:
print bug.status
else:
diff --git a/becommands/tag.py b/becommands/tag.py
index 216ffbc..08247cd 100644
--- a/becommands/tag.py
+++ b/becommands/tag.py
@@ -92,7 +92,7 @@ def execute(args, test=False):
if len(tags) > 0:
print '\n'.join(tags)
return
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 2:
given_tag = args[1]
estrs = bug.extra_strings
diff --git a/becommands/target.py b/becommands/target.py
index 527b16a..ec10ed6 100644
--- a/becommands/target.py
+++ b/becommands/target.py
@@ -53,7 +53,7 @@ def execute(args, test=False):
if target and isinstance(target,str):
print target
return
- bug = bd.bug_from_shortname(args[0])
+ bug = cmdutil.bug_from_shortname(bd, args[0])
if len(args) == 1:
if bug.target is None:
print "No target assigned."