mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 11:03:47 +03:00
minor adjustments
This commit is contained in:
parent
fffda32f76
commit
7ec04281dd
|
@ -953,6 +953,7 @@ def __setConfAttributes():
|
|||
conf.paramNegative = False
|
||||
conf.path = None
|
||||
conf.port = None
|
||||
conf.progressWidth = 54
|
||||
conf.retriesCount = 0
|
||||
conf.scheme = None
|
||||
#conf.seqMatcher = difflib.SequenceMatcher(lambda x: x in " \t")
|
||||
|
|
|
@ -23,19 +23,20 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
"""
|
||||
|
||||
from lib.core.common import dataToStdout
|
||||
from lib.core.data import conf
|
||||
|
||||
class ProgressBar:
|
||||
"""
|
||||
This class defines methods to update and draw a progress bar
|
||||
"""
|
||||
|
||||
def __init__(self, minValue=0, maxValue=10, totalWidth=54):
|
||||
def __init__(self, minValue=0, maxValue=10, totalWidth=None):
|
||||
self.__progBar = "[]"
|
||||
self.__oldProgBar = ""
|
||||
self.__min = int(minValue)
|
||||
self.__max = int(maxValue)
|
||||
self.__span = self.__max - self.__min
|
||||
self.__width = totalWidth
|
||||
self.__width = totalWidth if totalWidth else conf.progressWidth
|
||||
self.__amount = 0
|
||||
self.update()
|
||||
|
||||
|
|
|
@ -95,7 +95,6 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||
showEta = conf.eta and isinstance(length, int)
|
||||
numThreads = min(conf.threads, length)
|
||||
threads = []
|
||||
totalWidth = 54
|
||||
|
||||
if showEta:
|
||||
progress = ProgressBar(maxValue=length)
|
||||
|
@ -106,7 +105,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||
infoMsg = "starting %d threads" % numThreads
|
||||
logger.info(infoMsg)
|
||||
|
||||
dataToStdout("[%s] [INFO] retrieved: %s" % (time.strftime("%X"), "_" * min(length, totalWidth)))
|
||||
dataToStdout("[%s] [INFO] retrieved: %s" % (time.strftime("%X"), "_" * min(length, conf.progressWidth)))
|
||||
dataToStdout("\r[%s] [INFO] retrieved: " % time.strftime("%X"))
|
||||
else:
|
||||
dataToStdout("[%s] [INFO] retrieved: " % time.strftime("%X"))
|
||||
|
@ -191,8 +190,8 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||
if value[i] is not None:
|
||||
endCharIndex = max(endCharIndex, i)
|
||||
output = ''
|
||||
if endCharIndex > totalWidth:
|
||||
startCharIndex = endCharIndex - totalWidth
|
||||
if endCharIndex > conf.progressWidth:
|
||||
startCharIndex = endCharIndex - conf.progressWidth
|
||||
count = 0
|
||||
for i in xrange(startCharIndex, endCharIndex):
|
||||
output += '_' if value[i] is None else value[i]
|
||||
|
@ -200,7 +199,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
|
|||
count += 1 if value[i] is not None else 0
|
||||
if startCharIndex > 0:
|
||||
output = '...' + output[3:]
|
||||
if endCharIndex - startCharIndex == totalWidth:
|
||||
if endCharIndex - startCharIndex == conf.progressWidth:
|
||||
output = output[:-3] + '...'
|
||||
status = ' %d/%d' % (count, length)
|
||||
output += status if count != length else " "*len(status)
|
||||
|
|
Loading…
Reference in New Issue
Block a user