Patch: interceptor-aps-a-3-i
Changed the name from a-3 to a-3-i. No otherwise changes. Changed TESTMODE to TEST MODE
This commit is contained in:
@@ -7,11 +7,11 @@ import pyautogui
|
|||||||
import subprocess
|
import subprocess
|
||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
|
|
||||||
# ___ _ _ _ ____ ____
|
# ___ _ _ _ ____ ____
|
||||||
# |_ _|_ __ | |_ ___ _ __ ___ ___ _ __ | |_ ___ _ __ / \ | _ \/ ___|
|
# |_ _|_ __ | |_ ___ _ __ ___ ___ _ __ | |_ ___ _ __ / \ | _ \/ ___|
|
||||||
# | || '_ \| __/ _ \ '__/ __/ _ \ '_ \| __/ _ \| '__| / _ \ | |_) \___ \
|
# | || '_ \| __/ _ \ '__/ __/ _ \ '_ \| __/ _ \| '__| / _ \ | |_) \___ \
|
||||||
# | || | | | || __/ | | (_| __/ |_) | || (_) | | / ___ \| __/ ___) |
|
# | || | | | || __/ | | (_| __/ |_) | || (_) | | / ___ \| __/ ___) |
|
||||||
# |___|_| |_|\__\___|_| \___\___| .__/ \__\___/|_| /_/ \_\_| |____/
|
# |___|_| |_|\__\___|_| \___\___| .__/ \__\___/|_| /_/ \_\_| |____/
|
||||||
# |_| APS Version Alpha-3-i by P7MJ
|
# |_| APS Version Alpha-3-i by P7MJ
|
||||||
|
|
||||||
# ---------- Monitor Path ---------- #
|
# ---------- Monitor Path ---------- #
|
||||||
@@ -73,7 +73,7 @@ def launch_cover(programs):
|
|||||||
print("Launched Chrome.")
|
print("Launched Chrome.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(colored(f"Chrome Launch Error: {e}", 'red'))
|
print(colored(f"Chrome Launch Error: {e}", 'red'))
|
||||||
|
|
||||||
elif programs == "2": # Edge
|
elif programs == "2": # Edge
|
||||||
try:
|
try:
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
@@ -82,7 +82,7 @@ def launch_cover(programs):
|
|||||||
print("Launched Edge.")
|
print("Launched Edge.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(colored(f"Edge Launch Error: {e}", 'red'))
|
print(colored(f"Edge Launch Error: {e}", 'red'))
|
||||||
|
|
||||||
elif programs == "3": # Adobe Illustrator
|
elif programs == "3": # Adobe Illustrator
|
||||||
try:
|
try:
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
@@ -91,7 +91,7 @@ def launch_cover(programs):
|
|||||||
print("Launched Illustrator.")
|
print("Launched Illustrator.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(colored(f"Illustrator Launch Error: {e}", 'red'))
|
print(colored(f"Illustrator Launch Error: {e}", 'red'))
|
||||||
|
|
||||||
elif programs == "4": # Onenote
|
elif programs == "4": # Onenote
|
||||||
try:
|
try:
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
@@ -124,7 +124,7 @@ def specific_tab(browser, tab_no):
|
|||||||
window.restore()
|
window.restore()
|
||||||
window.activate()
|
window.activate()
|
||||||
print(f"{browser} has been brought to front.")
|
print(f"{browser} has been brought to front.")
|
||||||
|
|
||||||
print(f"Going to tab {tab_no} in browser...", end = " ")
|
print(f"Going to tab {tab_no} in browser...", end = " ")
|
||||||
try:
|
try:
|
||||||
pyautogui.hotkey('ctrl', '1')
|
pyautogui.hotkey('ctrl', '1')
|
||||||
@@ -153,14 +153,14 @@ def help_section():
|
|||||||
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 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("- (Note 6): Specifies a window name. Partial names (wildcards) are default.")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
# ---------- Main ---------- #
|
# ---------- Main ---------- #
|
||||||
testmode = False
|
testmode = False
|
||||||
def main():
|
def main():
|
||||||
global testmode
|
global testmode
|
||||||
while True:
|
while True:
|
||||||
print("=" * 80)
|
print("=" * 80)
|
||||||
print(f"Interceptor APS (Active Protection System) Alpha-3| TESTMODE: {testmode}")
|
print(f"Interceptor APS (Active Protection System) Alpha-3-i| TEST MODE: {testmode}")
|
||||||
print("-" * 80)
|
print("-" * 80)
|
||||||
print("Choose a cover app to open:")
|
print("Choose a cover app to open:")
|
||||||
print("[1] Chrome (note 1)")
|
print("[1] Chrome (note 1)")
|
||||||
@@ -186,7 +186,7 @@ def main():
|
|||||||
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}")
|
||||||
|
|
||||||
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 = " ")
|
||||||
@@ -199,7 +199,7 @@ def main():
|
|||||||
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!")
|
||||||
|
|
||||||
elif program == "6":
|
elif program == "6":
|
||||||
tabs_no = input("Tab number > ")
|
tabs_no = input("Tab number > ")
|
||||||
if tabs_no.isdigit():
|
if tabs_no.isdigit():
|
||||||
@@ -216,7 +216,7 @@ def main():
|
|||||||
else:
|
else:
|
||||||
print("Error: Not a digit")
|
print("Error: Not a digit")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
elif program == "7": # If name is chosen
|
elif program == "7": # If name is chosen
|
||||||
p_name = input("Name of window > ")
|
p_name = input("Name of window > ")
|
||||||
print(f"Window \"{p_name}\" selected. Watching...", end = " ")
|
print(f"Window \"{p_name}\" selected. Watching...", end = " ")
|
||||||
@@ -229,14 +229,14 @@ def main():
|
|||||||
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!")
|
||||||
|
|
||||||
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")
|
||||||
|
|
||||||
elif program.isalpha():
|
elif program.isalpha():
|
||||||
if program.lower() == "x":
|
if program.lower() == "x":
|
||||||
help_section()
|
help_section()
|
||||||
|
|
||||||
elif program.lower() == "y":
|
elif program.lower() == "y":
|
||||||
testmode = not testmode
|
testmode = not testmode
|
||||||
print(f"Test mode set to {testmode}\n")
|
print(f"Test mode set to {testmode}\n")
|
||||||
@@ -246,8 +246,8 @@ def main():
|
|||||||
print(f"Error: Option \"{program}\" selected and passed isalpha() criteria, but did not get selected")
|
print(f"Error: Option \"{program}\" selected and passed isalpha() criteria, but did not get selected")
|
||||||
else:
|
else:
|
||||||
print("Error: Not an option.")
|
print("Error: Not an option.")
|
||||||
|
|
||||||
|
|
||||||
# ---------- Main-main ---------- #
|
# ---------- Main-main ---------- #
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
Reference in New Issue
Block a user