mirror of
https://github.com/yavook/kiwi-scp.git
synced 2024-11-22 12:53:00 +00:00
neat prompt
This commit is contained in:
parent
322033ca92
commit
0433daa748
2 changed files with 14 additions and 8 deletions
|
@ -65,7 +65,7 @@ class NetDownCommand(SubCommand):
|
||||||
|
|
||||||
def run(self, runner, config, args):
|
def run(self, runner, config, args):
|
||||||
if not _find_net(config, args):
|
if not _find_net(config, args):
|
||||||
logging.info(f"Network '{config['network:name']}' already removed")
|
logging.info(f"Network '{config['network:name']}' does not exist")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
|
||||||
|
def _surround(string, bang):
|
||||||
|
midlane = f"{bang * 3} {string} {bang * 3}"
|
||||||
|
sidelane = bang*len(midlane)
|
||||||
|
|
||||||
|
return f"{sidelane}\n{midlane}\n{sidelane}"
|
||||||
|
|
||||||
|
|
||||||
def are_you_sure(prompt, default="no"):
|
def are_you_sure(prompt, default="no"):
|
||||||
if default.lower() == 'yes':
|
if default.lower() == 'yes':
|
||||||
suffix = "[YES|no]"
|
suffix = "[YES|no]"
|
||||||
|
@ -5,12 +13,10 @@ def are_you_sure(prompt, default="no"):
|
||||||
suffix = "[yes|NO]"
|
suffix = "[yes|NO]"
|
||||||
|
|
||||||
answer = input(
|
answer = input(
|
||||||
"!!!!!!!!!!!!!!!!!!\n"
|
f"{_surround('CAREFULING IN PROGRESS', '!')}\n"
|
||||||
"!!! BE CAREFUL !!!\n"
|
f"\n"
|
||||||
"!!!!!!!!!!!!!!!!!!\n"
|
f">>> {prompt} <<<\n"
|
||||||
"\n"
|
f"\n"
|
||||||
f"{prompt}\n"
|
|
||||||
"\n"
|
|
||||||
f"Are you sure you want to proceed? {suffix} "
|
f"Are you sure you want to proceed? {suffix} "
|
||||||
).strip().lower()
|
).strip().lower()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue