mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 14:55:40 +00:00
Minor refactoring
This commit is contained in:
parent
10be8a12bd
commit
15ef0f872f
5 changed files with 10 additions and 7 deletions
|
|
@ -10,6 +10,7 @@ import re
|
|||
import subprocess
|
||||
|
||||
from lib.core.common import getText
|
||||
from lib.core.common import openFile
|
||||
|
||||
def getRevisionNumber():
|
||||
"""
|
||||
|
|
@ -36,7 +37,7 @@ def getRevisionNumber():
|
|||
|
||||
while True:
|
||||
if filePath and os.path.isfile(filePath):
|
||||
with open(filePath, "r") as f:
|
||||
with openFile(filePath, "r") as f:
|
||||
content = f.read()
|
||||
filePath = None
|
||||
if content.startswith("ref: "):
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.3.5.81"
|
||||
VERSION = "1.3.5.82"
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ from lib.core.common import dataToStdout
|
|||
from lib.core.common import getSafeExString
|
||||
from lib.core.common import getLatestRevision
|
||||
from lib.core.common import getText
|
||||
from lib.core.common import openFile
|
||||
from lib.core.common import pollProcess
|
||||
from lib.core.common import readInput
|
||||
from lib.core.data import conf
|
||||
|
|
@ -82,7 +83,7 @@ def update():
|
|||
|
||||
filepath = os.path.join(paths.SQLMAP_ROOT_PATH, "lib", "core", "settings.py")
|
||||
if os.path.isfile(filepath):
|
||||
with open(filepath, "rb") as f:
|
||||
with openFile(filepath, "rb") as f:
|
||||
version = re.search(r"(?m)^VERSION\s*=\s*['\"]([^'\"]+)", f.read()).group(1)
|
||||
logger.info("updated to the latest version '%s#dev'" % version)
|
||||
success = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue