aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/list.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-14 23:15:58 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-14 23:15:58 -0500
commit1b9c628529848af370adbc67b5ba298236a1b86d (patch)
treedd16c447d971297637b59128c383c942a5578d1e /libbe/command/list.py
parent0786fc6693e40cdfaca7876b504acb3e5e7dc4d2 (diff)
downloadbugseverywhere-1b9c628529848af370adbc67b5ba298236a1b86d.tar.gz
Transitioned severity to Command-format, also added Command._get_*()
The old .requires_* thing was rediculous. The new ._get_*() callbacks allow the caller to provide a means for getting the expensive structures, which the command can use, or not, as required. This will also make it easier to implement the completion callbacks. The callbacks should probably have matching .set_*() methods, to avoid the current cache tweaking cmd._storage = ... etc. But that can wait for now...
Diffstat (limited to 'libbe/command/list.py')
-rw-r--r--libbe/command/list.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/libbe/command/list.py b/libbe/command/list.py
index 7c3f5af..8bdeaae 100644
--- a/libbe/command/list.py
+++ b/libbe/command/list.py
@@ -60,11 +60,13 @@ class List (libbe.command.Command):
>>> import libbe.bugdir
>>> bd = libbe.bugdir.SimpleBugDir(memory=False)
>>> cmd = List()
+ >>> cmd._storage = bd.storage
>>> cmd._setup_io = lambda i_enc,o_enc : None
>>> cmd.stdout = sys.stdout
- >>> ret = cmd.run(bd.storage, bd)
+
+ >>> ret = cmd.run()
abc/a:om: Bug A
- >>> ret = cmd.run(bd.storage, bd, {'status':'closed'})
+ >>> ret = cmd.run({'status':'closed'})
abc/b:cm: Bug B
>>> bd.storage.writeable
True
@@ -75,7 +77,6 @@ class List (libbe.command.Command):
def __init__(self, *args, **kwargs):
libbe.command.Command.__init__(self, *args, **kwargs)
- self.requires_bugdir = True
self.options.extend([
libbe.command.Option(name='status',
help='Only show bugs matching the STATUS specifier',
@@ -131,7 +132,8 @@ class List (libbe.command.Command):
#
# ])
- def _run(self, storage, bugdir, **params):
+ def _run(self, **params):
+ bugdir = self._get_bugdir()
writeable = bugdir.storage.writeable
bugdir.storage.writeable = False
cmp_list, status, severity, assigned, extra_strings_regexps = \