diff options
Diffstat (limited to 'libbe/command/set.py')
-rw-r--r-- | libbe/command/set.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libbe/command/set.py b/libbe/command/set.py index 4fe0117..46a63b4 100644 --- a/libbe/command/set.py +++ b/libbe/command/set.py @@ -34,19 +34,21 @@ class Set (libbe.command.Command): >>> import sys >>> import libbe.bugdir >>> bd = libbe.bugdir.SimpleBugDir(memory=False) - >>> cmd = Set() - >>> cmd._storage = bd.storage - >>> cmd._setup_io = lambda i_enc,o_enc : None - >>> cmd.stdout = sys.stdout + >>> io = libbe.command.StringInputOutput() + >>> io.stdout = sys.stdout + >>> ui = libbe.command.UserInterface(io=io) + >>> ui.storage_callbacks.set_storage(bd.storage) + >>> cmd = Set(ui=ui) - >>> ret = cmd.run(args=['target']) + >>> ret = ui.run(cmd, args=['target']) None - >>> ret = cmd.run(args=['target', 'abcdefg']) - >>> ret = cmd.run(args=['target']) + >>> ret = ui.run(cmd, args=['target', 'abcdefg']) + >>> ret = ui.run(cmd, args=['target']) abcdefg - >>> ret = cmd.run(args=['target', 'none']) - >>> ret = cmd.run(args=['target']) + >>> ret = ui.run(cmd, args=['target', 'none']) + >>> ret = ui.run(cmd, args=['target']) None + >>> ui.cleanup() >>> bd.cleanup() """ name = 'set' |