aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/list.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-14 01:12:08 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-14 01:12:08 -0500
commit9b1f9db34189744ded87a28aaa395d9344593df2 (patch)
treec1d9775842e6eac40ce366e81478cb657a84f146 /libbe/command/list.py
parent7addcc4aff8d391765b22d8f095afba739489511 (diff)
downloadbugseverywhere-9b1f9db34189744ded87a28aaa395d9344593df2.tar.gz
Transitioned assign to Command format
Diffstat (limited to 'libbe/command/list.py')
-rw-r--r--libbe/command/list.py27
1 files changed, 11 insertions, 16 deletions
diff --git a/libbe/command/list.py b/libbe/command/list.py
index ce43ec9..fd1debf 100644
--- a/libbe/command/list.py
+++ b/libbe/command/list.py
@@ -56,15 +56,18 @@ class Filter (object):
class List (libbe.command.Command):
"""List bugs
+ >>> import sys
>>> import libbe.bugdir
- >>> bd = libbe.bugdir.SimpleBugDir()
- >>> bd.uuid = '1234abcd'
+ >>> bd = libbe.bugdir.SimpleBugDir(memory=False)
>>> cmd = List()
>>> cmd._setup_io = lambda i_enc,o_enc : None
+ >>> cmd.stdout = sys.stdout
>>> cmd.run(bd)
- 123/a:om: Bug A
+ sim/a:om: Bug A
>>> cmd.run(bd, {'status':'closed'})
- 123/b:cm: Bug B
+ sim/b:cm: Bug B
+ >>> bd.storage.writeable
+ True
>>> bd.cleanup()
"""
@@ -129,6 +132,7 @@ class List (libbe.command.Command):
# ])
def _run(self, bugdir, **params):
+ writeable = bugdir.storage.writeable
bugdir.storage.writeable = False
cmp_list, status, severity, assigned, extra_strings_regexps = \
self._parse_params(params)
@@ -148,6 +152,7 @@ class List (libbe.command.Command):
print >> self.stdout, bug.uuid
else:
self._list_bugs(bugs, xml=params['xml'])
+ bugdir.storage.writeable = writeable
def _parse_params(self, params):
cmp_list = []
@@ -250,15 +255,5 @@ assigned
In addition, there are some shortcut options that set boolean flags.
The boolean options are ignored if the matching string option is used.
-""" % (','.join(bug.status_values), ','.join(bug.severity_values))
-
-def complete(options, args, parser):
- for option, value in cmdutil.option_value_pairs(options, parser):
- if value == "--complete":
- if option == "status":
- raise cmdutil.GetCompletions(bug.status_values)
- elif option == "severity":
- raise cmdutil.GetCompletions(bug.severity_values)
- raise cmdutil.GetCompletions()
- if "--complete" in args:
- raise cmdutil.GetCompletions() # no positional arguments for list
+""" % (','.join(libbe.bug.status_values),
+ ','.join(libbe.bug.severity_values))