Commits

Evgeny Podjachev  committed 36d6033

Fixedpylint warnings.

  • Participants
  • Parent commits 020d0e2

Comments (0)

Files changed (2)

File plugin/fastfileselector/gen_file_list.py

 import vim
 
 if int(vim.eval("g:FFS_ignore_case")):
-	import string
 	caseMod = str.lower
 else:
 	caseMod = lambda x: x
 
 		return False
 
-	fileList = []
+	res = []
 	for root, dirs, files in walk(path):
-		fileList.extend([join(root, f) for f in files if not in_ignore_list(f)])
+		res.extend([join(root, f) for f in files if not in_ignore_list(f)])
 
 		toRemove = [x for x in dirs if in_ignore_list(x)]
 		for j in toRemove:
 			dirs.remove(j)
 
 	n = len(path)
-	fileList = [(caseMod(x[n:]), x) for x in fileList]
+	res = [(caseMod(x[n:]), x) for x in res]
 
-	return fileList
+	return res
 
 wd = getcwdu()
-path = find_tags(wd)
-if path == None:
-	path = wd
+rootPath = find_tags(wd)
+if rootPath == None:
+	rootPath = wd
 	
-fileList = scan_dir(path, vim.eval("g:FFS_ignore_list"))
+fileList = scan_dir(rootPath, vim.eval("g:FFS_ignore_list"))
 
 if sys.version_info[0] < 3:
-	fileList = [(x[0].encode('utf-8'), x[1].encode('utf-8')) for x in fileList]
-	path = path.encode('utf-8')
+	fileList = [(fn[0].encode('utf-8'), fn[1].encode('utf-8')) for fn in fileList]
+	rootPath = rootPath.encode('utf-8')
 
-vim.command('let s:base_path_length=%d' % len(path))
+vim.command('let s:base_path_length=%d' % len(rootPath))
 vim.command('let s:file_list=[]')
-for i in fileList:
-	vim.command('let s:file_list+=[["%s","%s"]]' % (i[0].replace('\\', '\\\\'), (i[1].replace('\\', '\\\\'))))
+for fn in fileList:
+	vim.command('let s:file_list+=[["%s","%s"]]' % (fn[0].replace('\\', '\\\\'), (fn[1].replace('\\', '\\\\'))))
 

File plugin/fastfileselector/on_cursor_moved.py

 else:
 	caseMod = lambda x: x
 
-symbols = caseMod(vim.eval('str'))
+smbs = caseMod(vim.eval('str'))
 oldSymbols = caseMod(vim.eval('s:user_line'))
-if symbols.find(oldSymbols) != -1:
+if smbs.find(oldSymbols) != -1:
 	fileListVar = 's:filtered_file_list'
 else:
 	fileListVar = 's:file_list'
 
-if len(symbols) != 0:
-	nSymbols = len(symbols)
+if len(smbs) != 0:
+	nSymbols = len(smbs)
 	if nSymbols == 1:
 		check_symbols = check_symbols_1
 	elif nSymbols == 2:
 	else:
 		check_symbols = check_symbols_uni
 
-	fileList = [(check_symbols(x[0], symbols), x) for x in vim.eval(fileListVar)]
+	fileList = [(check_symbols(x[0], smbs), x) for x in vim.eval(fileListVar)]
 	fileList = [x for x in fileList if operator.itemgetter(0)]
 	fileList.sort(key=operator.itemgetter(0, 1))
 
 	vim.command("let s:filtered_file_list=[]")
-	for i in fileList:
-		vim.command('let s:filtered_file_list+=[["%s","%s"]]' % (i[1][0].replace('\\', '\\\\'), i[1][1].replace('\\', '\\\\')))
+	for fn in fileList:
+		vim.command('let s:filtered_file_list+=[["%s","%s"]]' % (fn[1][0].replace('\\', '\\\\'), fn[1][1].replace('\\', '\\\\')))
 else:
 	vim.command("let s:filtered_file_list = s:file_list")