From af9aae679c9ff107397cf427cf095684c18b2b1f Mon Sep 17 00:00:00 2001 From: snipe_blaze <72265661+notsniped@users.noreply.github.com> Date: Tue, 27 Sep 2022 15:04:40 +0530 Subject: [PATCH] Clean-up code --- app/main.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/main.py b/app/main.py index 0382cc3..2a7a3d8 100644 --- a/app/main.py +++ b/app/main.py @@ -38,10 +38,6 @@ def listen_for_command(errorcode): rescode = None if cmd.lower() == "exit": exit(0) else: rescode = os.system(cmd) - # if rescode != 0: - # print(f"{colors.red}Command failed with exit code: {rescode}{colors.end}") - # errcode = rescode - # else: errcode = None return rescode #def cleanup(reason: str): @@ -52,9 +48,9 @@ def listen_for_command(errorcode): # Initialization start() while True: - try: errcode = listen_for_command(errcode) + try: + errcode = listen_for_command(errcode) except KeyboardInterrupt: print("Keyboard Interrupt initialized. Cleaning up...") -# cleanup("Manually initialized exit [KeyboardInterrupt]") + # cleanup("Manually initialized exit [KeyboardInterrupt]") exit(130) -