From 03dc2109f3b5dcb8b4d93321c8df595ea6bce08d Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Sat, 20 Apr 2024 10:50:32 -0400 Subject: no log: pep8 fix --- bazarr.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'bazarr.py') diff --git a/bazarr.py b/bazarr.py index 58284ca09..7e75272b0 100644 --- a/bazarr.py +++ b/bazarr.py @@ -60,7 +60,7 @@ def start_bazarr(): ep = subprocess.Popen(script, stdout=None, stderr=None, stdin=subprocess.DEVNULL, env=os.environ) print(f"Bazarr starting child process with PID {ep.pid}...") return ep - + def terminate_child(): print(f"Terminating child process with PID {child_process.pid}") @@ -69,7 +69,7 @@ def terminate_child(): def get_stop_status_code(input_file): try: - with open(input_file,'r') as file: + with open(input_file, 'r') as file: # read status code from file, if it exists line = file.readline() try: @@ -77,7 +77,7 @@ def get_stop_status_code(input_file): except (ValueError, TypeError): status_code = EXIT_NORMAL file.close() - except: + except Exception: status_code = EXIT_NORMAL return status_code @@ -87,9 +87,9 @@ def check_status(): if os.path.exists(stop_file): status_code = get_stop_status_code(stop_file) try: - print(f"Deleting stop file...") + print("Deleting stop file...") os.remove(stop_file) - except Exception as e: + except Exception: print('Unable to delete stop file.') finally: terminate_child() @@ -97,13 +97,13 @@ def check_status(): if os.path.exists(restart_file): try: - print(f"Deleting restart file...") + print("Deleting restart file...") os.remove(restart_file) except Exception: print('Unable to delete restart file.') finally: terminate_child() - print(f"Bazarr is restarting...") + print("Bazarr is restarting...") child_process = start_bazarr() @@ -116,7 +116,7 @@ def interrupt_handler(signum, frame): interrupted = True print('Handling keyboard interrupt...') else: - print(f"Stop doing that! I heard you the first time!") + print("Stop doing that! I heard you the first time!") if __name__ == '__main__': @@ -148,5 +148,5 @@ if __name__ == '__main__': time.sleep(5) except (KeyboardInterrupt, SystemExit, ChildProcessError): # this code should never be reached, if signal handling is working properly - print(f'Bazarr exited main script file via keyboard interrupt.') + print('Bazarr exited main script file via keyboard interrupt.') exit_program(EXIT_INTERRUPT) -- cgit v1.2.3