Set number of matches to four and cutoff to 0.4

Review Request #8043 — Created March 9, 2016 and submitted

Information

RBTools
master
7910780...

Reviewers

Set number of matches to four and cutoff to 0.4

This script...

#!/usr/bin/env python2

import difflib

word = "git@git.example.org:/foo.git"
possibilities = ["/srv/git/repositories/baz.git", 
             "git://git.example.org/test.git", 
             "/srv/git/repositories/bar.git", 
             "/srv/git/repositories/test.git", 
             "/srv/git/repositories/website.git", 
             "/srv/git/repositories/foo.git"]
print(difflib.get_close_matches(word, possibilities, n=4))

...will return ['git://git.example.org/test.git'], while this script...

#!/usr/bin/env python2

import difflib

word = "git@git.example.org:/foo.git"
possibilities = ["/srv/git/repositories/baz.git", 
             "git://git.example.org/test.git", 
             "/srv/git/repositories/bar.git", 
             "/srv/git/repositories/test.git", 
             "/srv/git/repositories/website.git", 
             "/srv/git/repositories/foo.git"]
print(difflib.get_close_matches(word, possibilities, n=4, cutoff=0.4))

...will return ['git://git.example.org/test.git', '/srv/git/repositories/foo.git', '/srv/git/repositories/baz.git', '/srv/git/repositories/bar.git'].

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/commands/setup_repo.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/commands/setup_repo.py
    
    
  2. 
      
david
  1. Thanks for the fix! I'm going to push this with some changes to the commit message to match our usual styles.

  2. 
      
TO
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.7.x (72ee678)