aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/target.py
diff options
context:
space:
mode:
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())