diff options
author | W. Trevor King <wking@drexel.edu> | 2009-07-16 05:50:31 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-07-16 05:50:31 -0400 |
commit | dfb7878b674e8eed1cfa55928d5464dc6fb0f085 (patch) | |
tree | 7544d8433e20167c184bffda64dd8e3455e96d53 /becommands/close.py | |
parent | b39f68dcb0ecdc5f2c3f12fe75b47ff1f4d51e86 (diff) | |
download | bugseverywhere-dfb7878b674e8eed1cfa55928d5464dc6fb0f085.tar.gz |
Renamed test->manipulate_encodings in becommands.*.execute.
Reminder from my initial libbe/encoding.py commit:
Because of the stdout replacement, the doctests executes now need an
optional 'test' argument to turn off replacement during the doctests,
otherwise doctest flips out (since it had set up stdout to catch
output, and then we clobbered it's setup).
I'm also trying to catch stdout/stderr from be-handle-mail, and I ran
into the same problem. It took me a bit to remember exactly what
"test" was supposed to do, so I thought I'd make the argument name
more specific. If you need other changes when running in "test" mode,
you'll have to add other kwargs.
Diffstat (limited to 'becommands/close.py')
-rw-r--r-- | becommands/close.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/becommands/close.py b/becommands/close.py index 0ba8f50..05bdc10 100644 --- a/becommands/close.py +++ b/becommands/close.py @@ -20,7 +20,7 @@ from libbe import cmdutil, bugdir __desc__ = __doc__ -def execute(args, test=False): +def execute(args, manipulate_encodings=True): """ >>> from libbe import bugdir >>> import os @@ -28,7 +28,7 @@ def execute(args, test=False): >>> os.chdir(bd.root) >>> print bd.bug_from_shortname("a").status open - >>> execute(["a"], test=True) + >>> execute(["a"], manipulate_encodings=False) >>> bd._clear_bugs() >>> print bd.bug_from_shortname("a").status closed @@ -41,7 +41,8 @@ def execute(args, test=False): raise cmdutil.UsageError("Please specify a bug id.") if len(args) > 1: 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 = bd.bug_from_shortname(args[0]) bug.status = "closed" bd.save() |