mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 22:21:30 +00:00
Trivial refactoring
This commit is contained in:
@@ -2156,7 +2156,7 @@ def initCommonOutputs():
|
||||
if line not in kb.commonOutputs[key]:
|
||||
kb.commonOutputs[key].add(line)
|
||||
|
||||
def getFileItems(filename, commentPrefix='#', unicode_=True, lowercase=False, unique=False):
|
||||
def getFileItems(filename, commentPrefix='#', unicoded=True, lowercase=False, unique=False):
|
||||
"""
|
||||
Returns newline delimited items contained inside file
|
||||
"""
|
||||
@@ -2169,20 +2169,14 @@ def getFileItems(filename, commentPrefix='#', unicode_=True, lowercase=False, un
|
||||
checkFile(filename)
|
||||
|
||||
try:
|
||||
with openFile(filename, 'r', errors="ignore") if unicode_ else open(filename, 'r') as f:
|
||||
for line in (f.readlines() if unicode_ else f.xreadlines()): # xreadlines doesn't return unicode strings when codec.open() is used
|
||||
with openFile(filename, 'r', errors="ignore") if unicoded else open(filename, 'r') as f:
|
||||
for line in (f.readlines() if unicoded else f.xreadlines()): # xreadlines doesn't return unicode strings when codec.open() is used
|
||||
if commentPrefix:
|
||||
if line.find(commentPrefix) != -1:
|
||||
line = line[:line.find(commentPrefix)]
|
||||
|
||||
line = line.strip()
|
||||
|
||||
if not unicode_:
|
||||
try:
|
||||
line = str.encode(line)
|
||||
except UnicodeDecodeError:
|
||||
continue
|
||||
|
||||
if line:
|
||||
if lowercase:
|
||||
line = line.lower()
|
||||
|
||||
@@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
||||
from lib.core.enums import OS
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.2.5.7"
|
||||
VERSION = "1.2.5.8"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
||||
Reference in New Issue
Block a user