completer: Replace src[X] with src.X

Signed-off-by: Niels Thykier <niels@thykier.net>
email-direct-upload-sponsor
Niels Thykier 8 years ago
parent 0cc7f7a8d2
commit 166a6533ba

@ -16,6 +16,7 @@
import readline import readline
import bisect import bisect
class Completer(object): class Completer(object):
"""Completer class """Completer class
@ -48,14 +49,14 @@ class Completer(object):
(pkg, suite) = pkg.split("_") (pkg, suite) = pkg.split("_")
if "/" in pkg: if "/" in pkg:
pkg = pkg.split("/")[0] pkg = pkg.split("/")[0]
name = "%s/%s" % (e.name, britney.sources[suite][pkg][0]) # 0 == VERSION name = "%s/%s" % (e.name, britney.sources[suite][pkg].version)
complete.append(name) complete.append(name)
if suite == 'tpu': if suite == 'tpu':
tpu.append(name) tpu.append(name)
self.packages = sorted(complete) self.packages = sorted(complete)
self.tpu_packages = sorted(tpu) self.tpu_packages = sorted(tpu)
testing = britney.sources['testing'] testing = britney.sources['testing']
self.testing_packages = sorted("%s/%s" % (pkg, testing[pkg][0]) for pkg in testing) self.testing_packages = sorted("%s/%s" % (pkg, testing[pkg].version) for pkg in testing)
def completer(self, text, state): def completer(self, text, state):
"""readline completer (see the readline API)""" """readline completer (see the readline API)"""
@ -86,4 +87,3 @@ class Completer(object):
if len(self.matches) > state: if len(self.matches) > state:
return self.matches[state] return self.matches[state]
return None return None

Loading…
Cancel
Save