aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/html.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/html.py
parent80e76f70d58672167b17ddaced6c7856ba703ece (diff)
downloadbugseverywhere-cfae8a8302f06a84196700138d7ddbb25e91ea31.tar.gz
Added UserInterface and other improved abstractions for command handling
Diffstat (limited to 'libbe/command/html.py')
-rw-r--r--libbe/command/html.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/libbe/command/html.py b/libbe/command/html.py
index 99cd61f..7fd753a 100644
--- a/libbe/command/html.py
+++ b/libbe/command/html.py
@@ -36,12 +36,13 @@ class HTML (libbe.command.Command):
>>> import sys
>>> import libbe.bugdir
>>> bd = libbe.bugdir.SimpleBugDir(memory=False)
- >>> cmd = HTML()
- >>> 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 = HTML(ui=ui)
- >>> ret = cmd.run({'output':os.path.join(bd.storage.repo, 'html_export')})
+ >>> ret = ui.run(cmd, {'output':os.path.join(bd.storage.repo, 'html_export')})
>>> os.path.exists(os.path.join(bd.storage.repo, 'html_export'))
True
>>> os.path.exists(os.path.join(bd.storage.repo, 'html_export', 'index.html'))
@@ -54,6 +55,7 @@ class HTML (libbe.command.Command):
True
>>> os.path.exists(os.path.join(bd.storage.repo, 'html_export', 'bugs', 'b.html'))
True
+ >>> ui.cleanup()
>>> bd.cleanup()
"""
name = 'html'