Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 334c698

Browse files
committed
Adding change verbosity level in testing phase when Ctrl+C pressed
1 parent 304c982 commit 334c698

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

lib/controller/checks.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,20 @@ def genCmpPayload():
570570
warnMsg = "user aborted during detection phase"
571571
logger.warn(warnMsg)
572572

573-
msg = "how do you want to proceed? [(S)kip current test/(e)nd detection phase/(n)ext parameter/(q)uit]"
573+
msg = "how do you want to proceed? [(S)kip current test/(e)nd detection phase/(n)ext parameter/(c)hange verbosity/(q)uit]"
574574
choice = readInput(msg, default="S", checkBatch=False)
575575

576576
if choice[0] in ("s", "S"):
577577
pass
578+
elif choice[0] in ("c", "C"):
579+
choice = None
580+
while not ((choice or "").isdigit() and 0 <= int(choice) <= 6):
581+
if choice:
582+
logger.warn("invalid value")
583+
msg = "enter new verbosity level: [0-6] "
584+
choice = readInput(msg, default=str(conf.verbose), checkBatch=False).strip()
585+
conf.verbose = int(choice)
586+
setVerbosity()
578587
elif choice[0] in ("n", "N"):
579588
return None
580589
elif choice[0] in ("e", "E"):
@@ -1239,3 +1248,6 @@ def checkConnection(suppressOutput=False):
12391248
raise
12401249

12411250
return True
1251+
1252+
def setVerbosity(): # Cross-linked function
1253+
raise NotImplementedError

lib/core/option.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import urllib2
2020
import urlparse
2121

22+
import lib.controller.checks
2223
import lib.core.common
2324
import lib.core.threads
2425
import lib.core.convert
@@ -2167,6 +2168,7 @@ def _resolveCrossReferences():
21672168
lib.core.common.getPageTemplate = getPageTemplate
21682169
lib.core.convert.singleTimeWarnMessage = singleTimeWarnMessage
21692170
lib.request.connect.setHTTPProxy = _setHTTPProxy
2171+
lib.controller.checks.setVerbosity = setVerbosity
21702172

21712173
def initOptions(inputOptions=AttribDict(), overrideOptions=False):
21722174
if not inputOptions.disableColoring:

0 commit comments

Comments
 (0)