From aa7a503f7e6dd087540350d75e97b3b923ece8ca Mon Sep 17 00:00:00 2001 From: P7MJ Date: Mon, 9 Feb 2026 14:08:14 -0500 Subject: [PATCH] Patch: interceptor-aps-a-3-i Patched an error where in some modes, the cover app will launch after file watch is cancelled Patched an UI error where the monitoring text would not start on a new line Various UI enhancements: reduced size of monitoring text and changed some separators Help Section: Changes to note 5 --- ...eptor-aps-a-3.py => interceptor-aps-a-4.py | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) rename interceptor-aps-a-3.py => interceptor-aps-a-4.py (85%) diff --git a/interceptor-aps-a-3.py b/interceptor-aps-a-4.py similarity index 85% rename from interceptor-aps-a-3.py rename to interceptor-aps-a-4.py index f6e5c84..40450fd 100644 --- a/interceptor-aps-a-3.py +++ b/interceptor-aps-a-4.py @@ -12,7 +12,7 @@ from termcolor import colored # | || '_ \| __/ _ \ '__/ __/ _ \ '_ \| __/ _ \| '__| / _ \ | |_) \___ \ # | || | | | || __/ | | (_| __/ |_) | || (_) | | / ___ \| __/ ___) | # |___|_| |_|\__\___|_| \___\___| .__/ \__\___/|_| /_/ \_\_| |____/ -# |_| APS Version Alpha-2 by P7MJ +# |_| APS Version Alpha-3-i by P7MJ # ---------- Monitor Path ---------- # monitor_path = r"C:\Program Files\Renato Software\Senso.Cloud.Client" # Path to be monitored @@ -40,9 +40,8 @@ def bring_to_front(window_title): # ---------- File watch ---------- # def file_watch(iftest): - print("=" * 80) - print("Monitoring changes in " + monitor_path + ".") print("-" * 80) + print("Monitoring changes in " + monitor_path + ".") try: if iftest == False: for changes in watch(monitor_path): @@ -56,7 +55,7 @@ def file_watch(iftest): # ---------- Minimize ---------- # def minimize(): - print("=" * 80) + print("-" * 80) print("Minimizing all windows...", end = " ") pyautogui.hotkey('win', 'd') print("Completed.") @@ -64,7 +63,7 @@ def minimize(): # ---------- Launch cover (program) ---------- # def launch_cover(programs): time.sleep(0.5) - print("=" * 80) + print("-" * 80) print("Launching cover application...", end = " ") if programs == "1": # Chrome try: @@ -145,13 +144,14 @@ def specific_tab(browser, tab_no): # ---------- Help Section ---------- # def help_section(): - print() - print("- (1): Opens a new, empty window of this program") - print("- (2): Opens the window. You have to open the application first and set it up to the desired state to have it work.") - print("- (3): Opens an identical but new window of what you already have. The program can be closed, but you must set it up to the desired state before closing it.") - print("- (4): Enter a path to the program. This only opens the program and requires you to do research on the program behavior when opened.") - print("- (5): Opens the specified Chrome tab. This method is newly developed and is a bit slower to respond, but can precisely open any tab in Chrome.") - print("- (6): Specifies a window name. Partial names (wildcards) are default.") + print("-" * 80) + print("Help Section") + print("- (Note 1): Opens a new, empty window of this program") + print("- (Note 2): Opens the window. You have to open the application first and set it up to the desired state to have it work.") + print("- (Note 3): Opens an identical but new window of what you already have. The program can be closed, but you must set it up to the desired state before closing it.") + print("- (Note 4): Enter a path to the program. This only opens the program and requires you to do research on the program behavior when opened.") + print("- (Note 5): Opens the specified Chrome tab. This method is newly developed and is a bit slower to respond, but can precisely open any tab in Chrome. You must only have one Chrome window open, or the selector might not select the correct window.") + print("- (Note 6): Specifies a window name. Partial names (wildcards) are default.") print() # ---------- Main ---------- # @@ -180,39 +180,39 @@ def main(): print(f"Option {program} selected. Watching...") try: file_watch(testmode) + minimize() + launch_cover(program) except KeyboardInterrupt: print("User cancelled file watch.") except Exception as e: print(f"File watch error: {e}") - minimize() - launch_cover(program) if program == "5": # If path is selected (I doubt that) p_path = input("Enter full path >") print("Path selected. Watching...", end = " ") try: file_watch(testmode) + minimize() + launch_cover_path(p_path) except KeyboardInterrupt: print("User cancelled file watch.") except Exception as e: print(f"File watch error: {e}") print("File change detected!") - minimize() - launch_cover_path(p_path) # VERIFY IF DOUBLE ESCAPES ARE NEEDED WHEN PATH IS FIRST ENTERED BY USER elif program == "6": tabs_no = input("Tab number > ") if tabs_no.isdigit(): - print(f"Tab {tabs_no} selected. Watching...", end = " ") + print(f"Tab {tabs_no} selected. Watching...") try: file_watch(testmode) + minimize() + specific_tab("chrome", int(tabs_no)) except KeyboardInterrupt: print("User cancelled file watch.") except Exception as e: print(f"File watch error: {e}") print("File change detected!") - minimize() - specific_tab("chrome", int(tabs_no)) else: print("Error: Not a digit") pass @@ -222,13 +222,13 @@ def main(): print(f"Window \"{p_name}\" selected. Watching...", end = " ") try: file_watch(testmode) + minimize() + bring_to_front(p_name) except KeyboardInterrupt: print("User cancelled file watch.") except Exception as e: print(f"File watch error: {e}") print("File change detected!") - minimize() - bring_to_front(p_name) else: print(f"Error: Option \"{program}\" selected and passed isdigit() criteria, but did not get selected") @@ -239,7 +239,7 @@ def main(): elif program.lower() == "y": testmode = not testmode - print(f"Test mode set to {testmode}") + print(f"Test mode set to {testmode}\n") elif program.lower() == "c": sys.exit(0) else: