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/tag.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/tag.py')
-rw-r--r-- | becommands/tag.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/becommands/tag.py b/becommands/tag.py index a139528..2932589 100644 --- a/becommands/tag.py +++ b/becommands/tag.py @@ -18,7 +18,7 @@ from libbe import cmdutil, bugdir import os, copy __desc__ = __doc__ -def execute(args, test=False): +def execute(args, manipulate_encodings=True): """ >>> from libbe import utility >>> bd = bugdir.simple_bug_dir() @@ -26,25 +26,25 @@ def execute(args, test=False): >>> a = bd.bug_from_shortname("a") >>> print a.extra_strings [] - >>> execute(["a", "GUI"], test=True) + >>> execute(["a", "GUI"], manipulate_encodings=False) Tags for a: GUI >>> bd._clear_bugs() # resync our copy of bug >>> a = bd.bug_from_shortname("a") >>> print a.extra_strings ['TAG:GUI'] - >>> execute(["a", "later"], test=True) + >>> execute(["a", "later"], manipulate_encodings=False) Tags for a: GUI later - >>> execute(["a"], test=True) + >>> execute(["a"], manipulate_encodings=False) Tags for a: GUI later - >>> execute(["--list"], test=True) + >>> execute(["--list"], manipulate_encodings=False) GUI later - >>> execute(["a", "Alphabetically first"], test=True) + >>> execute(["a", "Alphabetically first"], manipulate_encodings=False) Tags for a: Alphabetically first GUI @@ -57,15 +57,15 @@ def execute(args, test=False): >>> print a.extra_strings [] >>> a.save() - >>> execute(["a"], test=True) + >>> execute(["a"], manipulate_encodings=False) >>> bd._clear_bugs() # resync our copy of bug >>> a = bd.bug_from_shortname("a") >>> print a.extra_strings [] - >>> execute(["a", "Alphabetically first"], test=True) + >>> execute(["a", "Alphabetically first"], manipulate_encodings=False) Tags for a: Alphabetically first - >>> execute(["--remove", "a", "Alphabetically first"], test=True) + >>> execute(["--remove", "a", "Alphabetically first"], manipulate_encodings=False) """ parser = get_parser() options, args = parser.parse_args(args) @@ -78,7 +78,8 @@ def execute(args, test=False): 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) if options.list: bd.load_all_bugs() tags = [] |