diff options
author | W. Trevor King <wking@drexel.edu> | 2009-12-31 14:32:39 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-12-31 14:32:39 -0500 |
commit | cfae8a8302f06a84196700138d7ddbb25e91ea31 (patch) | |
tree | e5e158f424e01edeb83c0d6132af8b5c1d1808ea /libbe/command/merge.py | |
parent | 80e76f70d58672167b17ddaced6c7856ba703ece (diff) | |
download | bugseverywhere-cfae8a8302f06a84196700138d7ddbb25e91ea31.tar.gz |
Added UserInterface and other improved abstractions for command handling
Diffstat (limited to 'libbe/command/merge.py')
-rw-r--r-- | libbe/command/merge.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libbe/command/merge.py b/libbe/command/merge.py index 328351e..0c34f69 100644 --- a/libbe/command/merge.py +++ b/libbe/command/merge.py @@ -30,10 +30,11 @@ class Merge (libbe.command.Command): >>> import libbe.bugdir >>> import libbe.comment >>> bd = libbe.bugdir.SimpleBugDir(memory=False) - >>> cmd = Merge() - >>> 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_bugdir(bd) + >>> cmd = Merge(ui=ui) >>> a = bd.bug_from_uuid('a') >>> a.comment_root.time = 0 @@ -49,7 +50,7 @@ class Merge (libbe.command.Command): >>> dummy = dummy.new_reply('1 2 3 4') >>> dummy.time = 2 - >>> ret = cmd.run(args=['/a', '/b']) + >>> ret = ui.run(cmd, args=['/a', '/b']) Merged bugs #abc/a# and #abc/b# >>> bd.flush_reload() >>> a = bd.bug_from_uuid('a') @@ -134,6 +135,7 @@ class Merge (libbe.command.Command): Merged into bug #abc/a# >>> print b.status closed + >>> ui.cleanup() >>> bd.cleanup() """ name = 'merge' |