aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/help.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-31 14:32:39 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-31 14:32:39 -0500
commitcfae8a8302f06a84196700138d7ddbb25e91ea31 (patch)
treee5e158f424e01edeb83c0d6132af8b5c1d1808ea /libbe/command/help.py
parent80e76f70d58672167b17ddaced6c7856ba703ece (diff)
downloadbugseverywhere-cfae8a8302f06a84196700138d7ddbb25e91ea31.tar.gz
Added UserInterface and other improved abstractions for command handling
Diffstat (limited to 'libbe/command/help.py')
-rw-r--r--libbe/command/help.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/libbe/command/help.py b/libbe/command/help.py
index 6e55598..d509d31 100644
--- a/libbe/command/help.py
+++ b/libbe/command/help.py
@@ -28,11 +28,12 @@ class Help (libbe.command.Command):
>>> import sys
>>> import libbe.bugdir
+ >>> io = libbe.command.StringInputOutput()
+ >>> io.stdout = sys.stdout
+ >>> ui = libbe.command.UserInterface(io=io)
>>> cmd = Help()
- >>> cmd._setup_io = lambda i_enc,o_enc : None
- >>> cmd.stdout = sys.stdout
- >>> ret = cmd.run(args=['help'])
+ >>> ret = ui.run(cmd, args=['help'])
usage: be help [options] [TOPIC]
<BLANKLINE>
Options:
@@ -61,8 +62,7 @@ class Help (libbe.command.Command):
elif params['topic'] in libbe.command.commands():
module = libbe.command.get_command(params['topic'])
Class = libbe.command.get_command_class(module,params['topic'])
- c = Class(get_unconnected_storage=self.get_unconnected_storage,
- ui=self.ui)
+ c = Class(ui=self.ui)
print >> self.stdout, c.help().rstrip('\n')
elif params['topic'] in TOPICS:
print >> self.stdout, TOPICS[params['topic']].rstrip('\n')