aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/due.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/due.py
parent80e76f70d58672167b17ddaced6c7856ba703ece (diff)
downloadbugseverywhere-cfae8a8302f06a84196700138d7ddbb25e91ea31.tar.gz
Added UserInterface and other improved abstractions for command handling
Diffstat (limited to 'libbe/command/due.py')
-rw-r--r--libbe/command/due.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/libbe/command/due.py b/libbe/command/due.py
index f3ad2f1..2eb3194 100644
--- a/libbe/command/due.py
+++ b/libbe/command/due.py
@@ -29,19 +29,21 @@ class Due (libbe.command.Command):
>>> import sys
>>> import libbe.bugdir
>>> bd = libbe.bugdir.SimpleBugDir(memory=False)
- >>> cmd = Due()
- >>> 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 = Due(ui=ui)
- >>> ret = cmd.run(args=['/a'])
+ >>> ret = ui.run(cmd, args=['/a'])
No due date assigned.
- >>> ret = cmd.run(args=['/a', 'Thu, 01 Jan 1970 00:00:00 +0000'])
- >>> ret = cmd.run(args=['/a'])
+ >>> ret = ui.run(cmd, args=['/a', 'Thu, 01 Jan 1970 00:00:00 +0000'])
+ >>> ret = ui.run(cmd, args=['/a'])
Thu, 01 Jan 1970 00:00:00 +0000
- >>> ret = cmd.run(args=['/a', 'none'])
- >>> ret = cmd.run(args=['/a'])
+ >>> ret = ui.run(cmd, args=['/a', 'none'])
+ >>> ret = ui.run(cmd, args=['/a'])
No due date assigned.
+ >>> ui.cleanup()
>>> bd.cleanup()
"""
name = 'due'