aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/util.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/util.py
parentd91aae83516d0326a0c4d19153f18d675674cc4c (diff)
downloadbugseverywhere-7e8237f5004a86be0bd90c77e0640cd265a61d72.tar.gz
Add entry points for functionality needed by CFBE (and probably other UIs)
Diffstat (limited to 'libbe/command/util.py')
-rw-r--r--libbe/command/util.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/libbe/command/util.py b/libbe/command/util.py
index c9618ad..977b596 100644
--- a/libbe/command/util.py
+++ b/libbe/command/util.py
@@ -34,12 +34,8 @@ def complete_command(command, argument, fragment=None):
"""
return list(libbe.command.commands())
-def complete_path(command, argument, fragment=None):
- """
- List possible path completions for fragment.
-
- command argument is not used.
- """
+def comp_path(fragment=None):
+ """List possible path completions for fragment."""
if fragment == None:
fragment = '.'
comps = glob.glob(fragment+'*') + glob.glob(fragment+'/*')
@@ -47,6 +43,10 @@ def complete_path(command, argument, fragment=None):
comps.extend(glob.glob(comps[0]+'/*'))
return comps
+def complete_path(command, argument, fragment=None):
+ """List possible path completions for fragment."""
+ return comp_path(fragment)
+
def complete_status(command, argument, fragment=None):
bd = command._get_bugdir()
import libbe.bug
@@ -57,10 +57,13 @@ def complete_severity(command, argument, fragment=None):
import libbe.bug
return libbe.bug.severity_values
+def assignees(bugdir):
+ bugdir.load_all_bugs()
+ return list(set([bug.assigned for bug in bugdir
+ if bug.assigned != None]))
+
def complete_assigned(command, argument, fragment=None):
- if fragment == None:
- return []
- return [fragment]
+ return assignees(command._get_bugdir())
def complete_extra_strings(command, argument, fragment=None):
if fragment == None: