mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-11-04 10:34:05 +00:00 
			
		
		
		
	Completer: offer tpu packages when completing "approve" hints
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
		
							parent
							
								
									3b03f1fefd
								
							
						
					
					
						commit
						74b087c13a
					
				@ -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)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user