unify Ctrl + D to exit and Ctrl + C to stop

This commit is contained in:
HappyZ 2019-01-29 14:00:32 -06:00
parent 0f04a49ef1
commit 3de5823b84
2 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -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: