aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/target.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2010-01-20 12:28:26 -0500
committerW. Trevor King <wking@drexel.edu>2010-01-20 12:28:26 -0500
commit7e8237f5004a86be0bd90c77e0640cd265a61d72 (patch)
tree380f080538c21520ba7fa75926a52f8df7f1ab4b /libbe/command/target.py
parentd91aae83516d0326a0c4d19153f18d675674cc4c (diff)
downloadbugseverywhere-7e8237f5004a86be0bd90c77e0640cd265a61d72.tar.gz
Add entry points for functionality needed by CFBE (and probably other UIs)
Diffstat (limited to 'libbe/command/target.py')
-rw-r--r--libbe/command/target.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/libbe/command/target.py b/libbe/command/target.py
index 0161772..4bfe82e 100644
--- a/libbe/command/target.py
+++ b/libbe/command/target.py
@@ -185,15 +185,24 @@ def add_target(bugdir, bug, summary):
return target
def targets(bugdir):
+ """Generate all possible target bug summaries."""
bugdir.load_all_bugs()
for bug in bugdir:
if bug.severity == 'target':
yield bug.summary
-def complete_target(command, argument, fragment=None):
+def target_dict(bugdir):
"""
- List possible command completions for fragment.
-
- argument argument is not used.
+ Return a dict with bug UUID keys and bug summary values for all
+ target bugs.
"""
+ ret = {}
+ bugdir.load_all_bugs()
+ for bug in bugdir:
+ if bug.severity == 'target':
+ ret[bug.uuid] = bug.summary
+ return ret
+
+def complete_target(command, argument, fragment=None):
+ """List possible command completions for fragment."""
return targets(command._get_bugdir())