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/target.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/target.py')
-rw-r--r-- | becommands/target.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/becommands/target.py b/becommands/target.py index 905c639..66bacb8 100644 --- a/becommands/target.py +++ b/becommands/target.py @@ -22,20 +22,20 @@ 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() >>> os.chdir(bd.root) - >>> execute(["a"], test=True) + >>> execute(["a"], manipulate_encodings=False) No target assigned. - >>> execute(["a", "tomorrow"], test=True) - >>> execute(["a"], test=True) + >>> execute(["a", "tomorrow"], manipulate_encodings=False) + >>> execute(["a"], manipulate_encodings=False) tomorrow - >>> execute(["--list"], test=True) + >>> execute(["--list"], manipulate_encodings=False) tomorrow - >>> execute(["a", "none"], test=True) - >>> execute(["a"], test=True) + >>> execute(["a", "none"], manipulate_encodings=False) + >>> execute(["a"], manipulate_encodings=False) No target assigned. """ parser = get_parser() @@ -46,7 +46,8 @@ def execute(args, test=False): if len(args) not in (1, 2): if not (options.list == True and len(args) == 0): raise cmdutil.UsageError - bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) + bd = bugdir.BugDir(from_disk=True, + manipulate_encodings=manipulate_encodings) if options.list: ts = set([bd.bug_from_uuid(bug).target for bug in bd.list_uuids()]) for target in sorted(ts): |