From 74b087c13a211259a2623c4ad52bb31684278356 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Sat, 16 Mar 2013 17:19:01 +0000 Subject: [PATCH] Completer: offer tpu packages when completing "approve" hints Signed-off-by: Adam D. Barratt --- completer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/completer.py b/completer.py index fa36676..6b89a10 100644 --- a/completer.py +++ b/completer.py @@ -37,6 +37,7 @@ class Completer(object): # generate a completion list from excuses. # - it might contain too many items, but meh complete = [] + tpu = [] for e in britney.excuses: ver = None pkg = e.name @@ -50,7 +51,10 @@ class Completer(object): pkg = pkg.split("/")[0] name = "%s/%s" % (e.name, britney.sources[suite][pkg][0]) # 0 == VERSION complete.append(name) + if suite == 'tpu': + tpu.append(name) self.packages = sorted(complete) + self.tpu_packages = sorted(tpu) testing = britney.sources['testing'] self.testing_packages = sorted("%s/%s" % (pkg, testing[pkg][0]) for pkg in testing) @@ -69,6 +73,8 @@ class Completer(object): # complete pkg/[arch/]version if words[0] == 'remove': packages = self.testing_packages + elif words[0] == 'approve': + packages = self.tpu_packages else: packages = self.packages start = bisect.bisect_left(packages, text)