Adding change verbosity level in testing phase when Ctrl+C pressed

This commit is contained in:
Miroslav Stampar 2013-10-17 16:54:53 +02:00
parent 304c9822bd
commit 334c698d53
2 changed files with 15 additions and 1 deletions

View File

@ -570,11 +570,20 @@ def checkSqlInjection(place, parameter, value):
warnMsg = "user aborted during detection phase"
logger.warn(warnMsg)
msg = "how do you want to proceed? [(S)kip current test/(e)nd detection phase/(n)ext parameter/(q)uit]"
msg = "how do you want to proceed? [(S)kip current test/(e)nd detection phase/(n)ext parameter/(c)hange verbosity/(q)uit]"
choice = readInput(msg, default="S", checkBatch=False)
if choice[0] in ("s", "S"):
pass
elif choice[0] in ("c", "C"):
choice = None
while not ((choice or "").isdigit() and 0 <= int(choice) <= 6):
if choice:
logger.warn("invalid value")
msg = "enter new verbosity level: [0-6] "
choice = readInput(msg, default=str(conf.verbose), checkBatch=False).strip()
conf.verbose = int(choice)
setVerbosity()
elif choice[0] in ("n", "N"):
return None
elif choice[0] in ("e", "E"):
@ -1239,3 +1248,6 @@ def checkConnection(suppressOutput=False):
raise
return True
def setVerbosity(): # Cross-linked function
raise NotImplementedError

View File

@ -19,6 +19,7 @@ import time
import urllib2
import urlparse
import lib.controller.checks
import lib.core.common
import lib.core.threads
import lib.core.convert
@ -2167,6 +2168,7 @@ def _resolveCrossReferences():
lib.core.common.getPageTemplate = getPageTemplate
lib.core.convert.singleTimeWarnMessage = singleTimeWarnMessage
lib.request.connect.setHTTPProxy = _setHTTPProxy
lib.controller.checks.setVerbosity = setVerbosity
def initOptions(inputOptions=AttribDict(), overrideOptions=False):
if not inputOptions.disableColoring: