mirror of
https://github.com/Ekultek/Zeus-Scanner.git
synced 2026-03-11 08:55:51 +00:00
created an interactive pause that you will be able to skip or exit from
This commit is contained in:
parent
00da736256
commit
3cfe4dfa8e
1 changed files with 23 additions and 2 deletions
|
|
@ -177,7 +177,7 @@ def shutdown():
|
|||
exit(0)
|
||||
|
||||
|
||||
def prompt(question, opts=None, default=None):
|
||||
def prompt(question, opts=None, default=None, paused=False):
|
||||
"""
|
||||
ask a question
|
||||
"""
|
||||
|
|
@ -207,9 +207,30 @@ def prompt(question, opts=None, default=None):
|
|||
)
|
||||
)
|
||||
return default
|
||||
elif opts is None and default is None and paused:
|
||||
opts = "[(s)kip (e)xit]"
|
||||
question_ = raw_input(
|
||||
"[{} {}] {} {}: ".format(
|
||||
time.strftime("%H:%M:%S"), "PROMPT", question, opts
|
||||
)
|
||||
)
|
||||
if question_.lower().startswith("s"):
|
||||
return True
|
||||
return False
|
||||
else:
|
||||
return raw_input(
|
||||
"[{} {}] {} ".format(
|
||||
time.strftime("%H:%M:%S"), "PROMPT", question
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def pause():
|
||||
"""
|
||||
interactive pause function, as of now you are only able to skip and exit
|
||||
from this function
|
||||
"""
|
||||
message = "program has been paused, how do you want to proceed?"
|
||||
return prompt(
|
||||
message, paused=True
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue