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
This commit is contained in:
@@ -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 ---------- #
|
||||||
monitor_path = r"C:\Program Files\Renato Software\Senso.Cloud.Client" # Path to be monitored
|
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 ---------- #
|
# ---------- File watch ---------- #
|
||||||
def file_watch(iftest):
|
def file_watch(iftest):
|
||||||
print("=" * 80)
|
|
||||||
print("Monitoring changes in " + monitor_path + ".")
|
|
||||||
print("-" * 80)
|
print("-" * 80)
|
||||||
|
print("Monitoring changes in " + monitor_path + ".")
|
||||||
try:
|
try:
|
||||||
if iftest == False:
|
if iftest == False:
|
||||||
for changes in watch(monitor_path):
|
for changes in watch(monitor_path):
|
||||||
@@ -56,7 +55,7 @@ def file_watch(iftest):
|
|||||||
|
|
||||||
# ---------- Minimize ---------- #
|
# ---------- Minimize ---------- #
|
||||||
def minimize():
|
def minimize():
|
||||||
print("=" * 80)
|
print("-" * 80)
|
||||||
print("Minimizing all windows...", end = " ")
|
print("Minimizing all windows...", end = " ")
|
||||||
pyautogui.hotkey('win', 'd')
|
pyautogui.hotkey('win', 'd')
|
||||||
print("Completed.")
|
print("Completed.")
|
||||||
@@ -64,7 +63,7 @@ def minimize():
|
|||||||
# ---------- Launch cover (program) ---------- #
|
# ---------- Launch cover (program) ---------- #
|
||||||
def launch_cover(programs):
|
def launch_cover(programs):
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
print("=" * 80)
|
print("-" * 80)
|
||||||
print("Launching cover application...", end = " ")
|
print("Launching cover application...", end = " ")
|
||||||
if programs == "1": # Chrome
|
if programs == "1": # Chrome
|
||||||
try:
|
try:
|
||||||
@@ -145,13 +144,14 @@ def specific_tab(browser, tab_no):
|
|||||||
|
|
||||||
# ---------- Help Section ---------- #
|
# ---------- Help Section ---------- #
|
||||||
def help_section():
|
def help_section():
|
||||||
print()
|
print("-" * 80)
|
||||||
print("- (1): Opens a new, empty window of this program")
|
print("Help Section")
|
||||||
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("- (Note 1): Opens a new, empty window of this program")
|
||||||
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("- (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("- (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 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("- (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("- (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("- (6): Specifies a window name. Partial names (wildcards) are default.")
|
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()
|
print()
|
||||||
|
|
||||||
# ---------- Main ---------- #
|
# ---------- Main ---------- #
|
||||||
@@ -180,39 +180,39 @@ def main():
|
|||||||
print(f"Option {program} selected. Watching...")
|
print(f"Option {program} selected. Watching...")
|
||||||
try:
|
try:
|
||||||
file_watch(testmode)
|
file_watch(testmode)
|
||||||
|
minimize()
|
||||||
|
launch_cover(program)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("User cancelled file watch.")
|
print("User cancelled file watch.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"File watch error: {e}")
|
print(f"File watch error: {e}")
|
||||||
minimize()
|
|
||||||
launch_cover(program)
|
|
||||||
|
|
||||||
if program == "5": # If path is selected (I doubt that)
|
if program == "5": # If path is selected (I doubt that)
|
||||||
p_path = input("Enter full path >")
|
p_path = input("Enter full path >")
|
||||||
print("Path selected. Watching...", end = " ")
|
print("Path selected. Watching...", end = " ")
|
||||||
try:
|
try:
|
||||||
file_watch(testmode)
|
file_watch(testmode)
|
||||||
|
minimize()
|
||||||
|
launch_cover_path(p_path)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("User cancelled file watch.")
|
print("User cancelled file watch.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"File watch error: {e}")
|
print(f"File watch error: {e}")
|
||||||
print("File change detected!")
|
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":
|
elif program == "6":
|
||||||
tabs_no = input("Tab number > ")
|
tabs_no = input("Tab number > ")
|
||||||
if tabs_no.isdigit():
|
if tabs_no.isdigit():
|
||||||
print(f"Tab {tabs_no} selected. Watching...", end = " ")
|
print(f"Tab {tabs_no} selected. Watching...")
|
||||||
try:
|
try:
|
||||||
file_watch(testmode)
|
file_watch(testmode)
|
||||||
|
minimize()
|
||||||
|
specific_tab("chrome", int(tabs_no))
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("User cancelled file watch.")
|
print("User cancelled file watch.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"File watch error: {e}")
|
print(f"File watch error: {e}")
|
||||||
print("File change detected!")
|
print("File change detected!")
|
||||||
minimize()
|
|
||||||
specific_tab("chrome", int(tabs_no))
|
|
||||||
else:
|
else:
|
||||||
print("Error: Not a digit")
|
print("Error: Not a digit")
|
||||||
pass
|
pass
|
||||||
@@ -222,13 +222,13 @@ def main():
|
|||||||
print(f"Window \"{p_name}\" selected. Watching...", end = " ")
|
print(f"Window \"{p_name}\" selected. Watching...", end = " ")
|
||||||
try:
|
try:
|
||||||
file_watch(testmode)
|
file_watch(testmode)
|
||||||
|
minimize()
|
||||||
|
bring_to_front(p_name)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("User cancelled file watch.")
|
print("User cancelled file watch.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"File watch error: {e}")
|
print(f"File watch error: {e}")
|
||||||
print("File change detected!")
|
print("File change detected!")
|
||||||
minimize()
|
|
||||||
bring_to_front(p_name)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print(f"Error: Option \"{program}\" selected and passed isdigit() criteria, but did not get selected")
|
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":
|
elif program.lower() == "y":
|
||||||
testmode = not testmode
|
testmode = not testmode
|
||||||
print(f"Test mode set to {testmode}")
|
print(f"Test mode set to {testmode}\n")
|
||||||
elif program.lower() == "c":
|
elif program.lower() == "c":
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
Reference in New Issue
Block a user