diff options
Diffstat (limited to 'becommands/remove.py')
-rw-r--r-- | becommands/remove.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/becommands/remove.py b/becommands/remove.py index d79a7be..8d85033 100644 --- a/becommands/remove.py +++ b/becommands/remove.py @@ -17,22 +17,23 @@ from libbe import cmdutil, bugdir __desc__ = __doc__ -def execute(args, test=False): +def execute(args, manipulate_encodings=True): """ >>> from libbe import mapfile >>> import os - >>> bd = bugdir.simple_bug_dir() + >>> bd = bugdir.SimpleBugDir() >>> os.chdir(bd.root) >>> print bd.bug_from_shortname("b").status closed - >>> execute (["b"], test=True) + >>> execute (["b"], manipulate_encodings=False) Removed bug b >>> bd._clear_bugs() >>> try: ... bd.bug_from_shortname("b") - ... except KeyError: + ... except bugdir.NoBugMatches: ... print "Bug not found" Bug not found + >>> bd.cleanup() """ parser = get_parser() options, args = parser.parse_args(args) @@ -40,8 +41,9 @@ def execute(args, test=False): bugid_args={0: lambda bug : bug.active==True}) 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]) + bd = bugdir.BugDir(from_disk=True, + manipulate_encodings=manipulate_encodings) + bug = cmdutil.bug_from_shortname(bd, args[0]) bd.remove_bug(bug) print "Removed bug %s" % bug.uuid |