Merge lp:~evfool/checkbox/secondfix786924 into lp:checkbox
Proposed by
Robert Roth
Status: | Merged |
---|---|
Merged at revision: | 915 |
Proposed branch: | lp:~evfool/checkbox/secondfix786924 |
Merge into: | lp:checkbox |
Diff against target: |
13 lines (+3/-1) 1 file modified
checkbox_cli/cli_interface.py (+3/-1) |
To merge this branch: | bzr merge lp:~evfool/checkbox/secondfix786924 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marc Tardif (community) | Approve | ||
Jeff Lane | Pending | ||
Review via email: mp+62156@code.launchpad.net |
Description of the change
Replaced the current string.
I have changed the fix to iterate over the characters of the option until it finds one that is not used yet in the keys. If all the characters of the option are used, it will find a letter from the alphabet which is not used yet. This should solve the problem for options starting with the same letter, eg "Yes/No/Not tested" will have the options y/n/o.
To post a comment you must log in.
The count variable can be assigned any integer value between 0 and len(findkey)-1. However, considering len(findkey) > len(option), this code is likely to result in a IndexError exception:
key = option[ count]. lower()
Also, instead of using a count variable, you might like to try something like:
for key in option.lower() + string.lowercase:
if key not in self.keys:
break