From 44352da6110744d626226ed9fd0bcc40bc4ad3c9 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Wed, 4 Jan 2012 18:07:45 +0100 Subject: [PATCH] Re-added support for completing removals in tab-completer The broken "do_hint" was caused by lack of versions in the resulting hint. Signed-off-by: Niels Thykier --- completer.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/completer.py b/completer.py index cbf6117..7a2fb3f 100644 --- a/completer.py +++ b/completer.py @@ -34,16 +34,16 @@ class Completer: # - it might contain too many items, but meh complete = [] for e in britney.excuses: - if e.name[0] == '-': - # do_hint does not work with removals anyway - continue - else: - ver = None - pkg = e.name - if "/" in pkg: - pkg = pkg.split("/")[0] - name = "%s/%s" % (e.name, britney.sources['unstable'][pkg][0]) # 0 == VERSION - complete.append(name) + ver = None + pkg = e.name + suite = 'unstable' + if pkg[0] == '-': + suite = 'testing' + pkg = pkg[1:] + if "/" in pkg: + pkg = pkg.split("/")[0] + name = "%s/%s" % (e.name, britney.sources[suite][pkg][0]) # 0 == VERSION + complete.append(name) self.packages = sorted(complete) def completer(self, text, state):