aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/assign.py
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2009-10-05 23:15:39 -0400
committerChris Ball <cjb@laptop.org>2009-10-05 23:15:39 -0400
commitb6a50c703369467132876f21efa8e4ffc672afae (patch)
tree905a9ae34efa2bce47d754893093b016d18d0162 /becommands/assign.py
parent6a639574fa95e50f82fa3052e5524b961295a7ab (diff)
parente35ccf95ea89b6e622202caae30d3b8cca3f2473 (diff)
downloadbugseverywhere-b6a50c703369467132876f21efa8e4ffc672afae.tar.gz
Large merge from W. Trevor King, including Gianluca's HTML export.
Diffstat (limited to 'becommands/assign.py')
-rw-r--r--becommands/assign.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/becommands/assign.py b/becommands/assign.py
index 536bca6..794f028 100644
--- a/becommands/assign.py
+++ b/becommands/assign.py
@@ -20,28 +20,29 @@
from libbe import cmdutil, bugdir
__desc__ = __doc__
-def execute(args, test=False):
+def execute(args, manipulate_encodings=True):
"""
>>> import os
- >>> bd = bugdir.simple_bug_dir()
+ >>> bd = bugdir.SimpleBugDir()
>>> os.chdir(bd.root)
>>> bd.bug_from_shortname("a").assigned is None
True
- >>> execute(["a"], test=True)
+ >>> execute(["a"], manipulate_encodings=False)
>>> bd._clear_bugs()
>>> bd.bug_from_shortname("a").assigned == bd.user_id
True
- >>> execute(["a", "someone"], test=True)
+ >>> execute(["a", "someone"], manipulate_encodings=False)
>>> bd._clear_bugs()
>>> print bd.bug_from_shortname("a").assigned
someone
- >>> execute(["a","none"], test=True)
+ >>> execute(["a","none"], manipulate_encodings=False)
>>> bd._clear_bugs()
>>> bd.bug_from_shortname("a").assigned is None
True
+ >>> bd.cleanup()
"""
parser = get_parser()
options, args = parser.parse_args(args)
@@ -53,7 +54,9 @@ def execute(args, test=False):
if len(args) > 2:
help()
raise cmdutil.UsageError("Too many arguments.")
- bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+ bd = bugdir.BugDir(from_disk=True,
+ manipulate_encodings=manipulate_encodings)
+ bug = cmdutil.bug_from_shortname(bd, args[0])
bug = bd.bug_from_shortname(args[0])
if len(args) == 1:
bug.assigned = bd.user_id