From: Thierry Parmentelat Date: Wed, 11 Jul 2012 12:17:51 +0000 (+0200) Subject: bugfix, candidates needs to recognize an input when it exactly matches X-Git-Tag: sfa-2.1-13~4 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=fd3509de5c4e147252354e02fda2f2f6fae64e6d;p=sfa.git bugfix, candidates needs to recognize an input when it exactly matches --- diff --git a/sfa/client/candidates.py b/sfa/client/candidates.py index a49f4429..f3a99ae3 100644 --- a/sfa/client/candidates.py +++ b/sfa/client/candidates.py @@ -9,13 +9,14 @@ class Candidates: # returns one of the names if the input name has a unique match # or None otherwise def only_match (self, input): + if input in self.names: return input matches=[ name for name in self.names if Candidates.fits(input,name) ] if len(matches)==1: return matches[0] else: return None #################### minimal test candidates_specs=[ -('create delete reset resources slices start status stop version', +('create delete reset resources slices start status stop version create_gid', [ ('ver','version'), ('r',None), ('re',None), @@ -28,6 +29,12 @@ candidates_specs=[ ('sta',None), ('stop','stop'), ('a',None), + ('cre',None), + ('create','create'), + ('create_','create_gid'), + ('create_g','create_gid'), + ('create_gi','create_gid'), + ('create_gid','create_gid'), ]) ]