diff --git a/discordHelperWin.py b/discordHelperWin.py index 38ed48d..c23bb3f 100644 --- a/discordHelperWin.py +++ b/discordHelperWin.py @@ -3,19 +3,24 @@ A windows executable for the discordHelper.py script. """ import os import sys - import discordHelper import time # All modules must be loaded before the main program is run. from modules import spidey_test, test_template - if __name__ == "__main__": - argv = sys.argv[1:] - if len(argv) == 0: - user_path = os.path.join(os.path.expanduser("~"), "Documents", "DiscordHelper") - argv = f"--all --launch --continue --timeout 12 --gen-data {user_path}/new_test_data_{int(time.time())}.yaml".split(" ") + try: + argv = sys.argv[1:] + if len(argv) == 0: + user_path = os.path.join(os.path.expanduser("~"), "Documents", "DiscordHelper") + argv = f"--all --launch --continue --timeout 12 --gen-data {user_path}/new_test_data_{int(time.time())}.yaml".split(" ") - args = discordHelper.argument_parser.parse(argv) - discordHelper.main(args) + args = discordHelper.argument_parser.parse(argv) + + discordHelper.main(args) + except Exception as e: + print(e) + print("An error occured, please check the console for more information...") + time.sleep(5) + sys.exit(1) diff --git a/modules/agnostic_paths.py b/modules/agnostic_paths.py index d618dee..e3e817f 100644 --- a/modules/agnostic_paths.py +++ b/modules/agnostic_paths.py @@ -175,13 +175,3 @@ class AgnosticPaths: :rtype: str """ return self.main_path - - -if __name__ == '__main__': - path = AgnosticPaths("") - print(path) - print(path.version) - print(path.list()) - print(path()) - print(path("resources", "bootstrap")) # Return the main_path plus resources, bootstrap - print(path.list_dir_files("resources", "bootstrap")) # List the base_path/resources/bootstrap and return [[folders], [files]] diff --git a/modules/main_runner.py b/modules/main_runner.py index 4551b70..cedf90f 100644 --- a/modules/main_runner.py +++ b/modules/main_runner.py @@ -12,6 +12,9 @@ All modules that can be tested Associate the arguments passed to the command line with the modules to be loaded argparse argument : [module_name, class_name] """ +from termcolor import colored, cprint +os.system('color') + _TEST_MODULES = { "spidey": ["spidey_test", "SpideyTest"], #"test_walk": ["test_template", "TestWalkTemplate"], @@ -22,27 +25,23 @@ POST_RUN_ALLOWED = False queue_lock = threading.Lock() -CLEAR_CODE = r""" +CLEAR_CODE = colored(r""" _______ _ (_______) | _ | | _____ _____ ____ | | | || ___ (____ |/ ___) | |_____| || ____/ ___ | | \______)\_)_____)_____|_| - """ + """, 'green') -INFECTED_CODE = r""" +INFECTED_CODE = colored(r""" _ ___ _ | | / __) _ | | | |____ _| |__ _____ ____ _| |_ _____ __| | | | _ (_ __) ___ |/ ___|_ _) ___ |/ _ | | | | | || | | ____( (___ | |_| ____( (_| | |_|_| |_||_| |_____)\____) \__)_____)\____| -""" - -if os.name == "nt": - CLEAR_CODE = r"" + CLEAR_CODE + r"" - INFECTED_CODE = r"" + INFECTED_CODE + r"" +""", 'red') class TestRunner: diff --git a/ressources/DiscordHelper.ico b/ressources/DiscordHelper.ico new file mode 100644 index 0000000..9285a80 Binary files /dev/null and b/ressources/DiscordHelper.ico differ diff --git a/ressources/DiscordHelper.png b/ressources/DiscordHelper.png new file mode 100644 index 0000000..229bd66 Binary files /dev/null and b/ressources/DiscordHelper.png differ diff --git a/winspec.spec b/winspec.spec index 7deedea..bace872 100644 --- a/winspec.spec +++ b/winspec.spec @@ -41,4 +41,5 @@ exe = EXE( target_arch=None, codesign_identity=None, entitlements_file=None, + icon='ressources/DiscordHelper.ico', )