unify Ctrl + D to exit and Ctrl + C to stop
This commit is contained in:
parent
0f04a49ef1
commit
3de5823b84
|
|
@ -42,11 +42,16 @@ def interactive(dpt, diagnosis=False):
|
|||
cmd = input(">>> ")
|
||||
cmd = cmd.lower() # convert to lower case
|
||||
except KeyboardInterrupt:
|
||||
print()
|
||||
dpt.info_print("Press Ctrl + D to exit")
|
||||
continue
|
||||
except EOFError:
|
||||
print()
|
||||
dpt.info_print("Exiting... Thanks for using...")
|
||||
break
|
||||
except BaseException as e:
|
||||
print()
|
||||
cmd = ''
|
||||
dpt.err_print(str(e))
|
||||
if cmd == 'root':
|
||||
obtain_diagnosis_access(dpt)
|
||||
|
|
|
|||
|
|
@ -617,7 +617,8 @@ def diagnosis_cmd(dpt):
|
|||
for line in resp:
|
||||
print(line)
|
||||
except KeyboardInterrupt:
|
||||
break
|
||||
dpt.info_print("\nPress Ctrl + D to exit")
|
||||
continue
|
||||
except EOFError:
|
||||
break
|
||||
except BaseException as e:
|
||||
|
|
|
|||
Loading…
Reference in New Issue