diff --git a/.gitignore b/.gitignore index b384ee0..cf44e1e 100644 --- a/.gitignore +++ b/.gitignore @@ -133,3 +133,6 @@ dmypy.json # PyCharm Settings .idea + +# pluGET Files +pluGET_config.yaml diff --git a/install_requirements.py b/install_requirements.py new file mode 100644 index 0000000..b2c4428 --- /dev/null +++ b/install_requirements.py @@ -0,0 +1,12 @@ +""" + Install the needed python packages through this script +""" + +import os + +try: + print("Installing Python packages and dependencies from requirements.txt...") + os.system('py -m pip install -r requirements.txt' if os.name=='nt' else 'pip install -r requirements.txt') +except: + print("Requirements couldn't be installed. Check if file 'requirements.txt' is in the same folder and that Python3\ + and pip is installed!") diff --git a/installer.bat b/installer.bat deleted file mode 100644 index c2e20b9..0000000 --- a/installer.bat +++ /dev/null @@ -1,34 +0,0 @@ -@ECHO OFF - -cd /d %~dp0 - -Echo ___ ___ ___ ___ ___ ___ -Echo /\ \ /\__\ /\__\ /\ \ /\ \ /\ \ -Echo /::\ \ /:/ / /:/ / /::\ \ /::\ \ \:\ \ -Echo /:/\:\ \ /:/ / /:/ / /:/\:\ \ /:/\:\ \ \:\ \ -Echo /::\~\:\ \ /:/ / /:/ / ___ /:/ \:\ \ /::\~\:\ \ /::\ \ -Echo /:/\:\ \:\__\ /:/__/ /:/__/ /\__\ /:/__/_\:\__\ /:/\:\ \:\__\ /:/\:\__\ -Echo \/__\:\/:/ / \:\ \ \:\ \ /:/ / \:\ /\ \/__/ \:\~\:\ \/__/ /:/ \/__/ -Echo \::/ / \:\ \ \:\ /:/ / \:\ \:\__\ \:\ \:\__\ /:/ / -Echo \/__/ \:\ \ \:\/:/ / \:\/:/ / \:\ \/__/ \/__/ -Echo \:\__\ \::/ / \::/ / \:\__\ -Echo \/__/ \/__/ \/__/ \/__/ -Echo ` -Echo ` -Echo ------------------------------------ -Echo [By Neocky] -Echo https://github.com/Neocky/pluGET -Echo pluGET-Installer -Echo ------------------------------------ -Echo ` -Echo ---------------------------------------------------------------------------------- -Echo Installing Python packages and dependencies... - -py -m pip install -r requirements.txt - -Echo ` -Echo Launching pluGET... - -launcher.bat - -exit diff --git a/launcher.bat b/launcher.bat deleted file mode 100644 index 56d88e1..0000000 --- a/launcher.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -cd "%~dp0" -cd src -py "__main__.py" \ No newline at end of file diff --git a/launcher.sh b/launcher.sh deleted file mode 100644 index 9875e6a..0000000 --- a/launcher.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd src/ -python3 "__main__.py" diff --git a/pluGET.py b/pluGET.py index ccdf527..2a9e47a 100644 --- a/pluGET.py +++ b/pluGET.py @@ -16,6 +16,7 @@ except: if __name__ == "__main__": check_config() + rename_console_title() #check_requirements() parser = argparse.ArgumentParser(description="Just an example", formatter_class=argparse.ArgumentDefaultsHelpFormatter) @@ -30,14 +31,10 @@ if __name__ == "__main__": else: print("no arguments") - #consoleTitle() - #clearConsole() + clear_console() #createInputLists() - #printMainMenu() #getInput() - rename_console_title() - clear_console() - print_logo() + print_logo() config = config_value() validate_config() print(config.connection) diff --git a/src/handlers/handle_config.py b/src/handlers/handle_config.py index 1ab4bd4..702d915 100644 --- a/src/handlers/handle_config.py +++ b/src/handlers/handle_config.py @@ -17,7 +17,7 @@ class config_value(): """ def __init__(self): yaml = ruamel.yaml.YAML() - with open("pluget_config.yaml", "r") as config_file: + with open("pluGET_config.yaml", "r") as config_file: data = yaml.load(config_file) self.connection = data["Connection"] self.path_to_plugin_folder = Path(data["Local"]["PathToPluginFolder"]) @@ -35,16 +35,16 @@ class config_value(): def check_config() -> None: """ - Check if there is a pluget_config.yml file in the same folder as pluget.py and if not create a new config + Check if there is a pluGET_config.yml file in the same folder as pluget.py and if not create a new config and exit the programm """ - if not os.path.isfile("pluget_config.yaml"): + if not os.path.isfile("pluGET_config.yaml"): create_config() def create_config() -> None: """ - Creates the yaml config in the current directory with the filename pluget_config.yml + Creates the yaml config in the current directory with the filename pluGET_config.yml """ # this is the whole yaml code because of weird formating indention is not possible configuration = """\ @@ -78,11 +78,10 @@ def create_config() -> None: # load ruamel.yaml to get the # commands right in the yaml code yaml = ruamel.yaml.YAML() code = yaml.load(configuration) - print(code['Local']['SeperateDownloadPath']) - with open("pluget_config.yaml", "w") as config_file: + with open("pluGET_config.yaml", "w") as config_file: yaml.dump(code, config_file) - config_file_path = os.path.abspath("pluget_config.yaml") + config_file_path = os.path.abspath("pluGET_config.yaml") print(f"Path of config file: {config_file_path}") print("Config created. Edit config before executing again!") input("Press any key + enter to exit...") diff --git a/src/utils/console_output.py b/src/utils/console_output.py index 0ac54df..cd124f0 100644 --- a/src/utils/console_output.py +++ b/src/utils/console_output.py @@ -19,7 +19,12 @@ def clear_console() -> None: """ os.system('cls' if os.name=='nt' else 'clear') + def print_logo() -> None: + """ + Prints the logo of pluGET and the link to the github repo + """ + # use rich console console = Console() # line 1 console.print() @@ -56,18 +61,66 @@ def print_logo() -> None: console.print("██", style="bright_magenta", end='') console.print("╔══╝", style="bright_yellow") # line 4 - console.print(" ██████╔╝██║ ██║ ██║██║ ███╗█████╗ ██║ ") + console.print(" ██████", style="bright_magenta", end='') + console.print("╔╝", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow", end='') + console.print("███", style="bright_magenta", end='') + console.print("╗", style="bright_yellow", end='') + console.print("█████", style="bright_magenta", end='') + console.print("╗ ", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow") # line 5 - console.print(" ██╔═══╝ ██║ ██║ ██║██║ ██║██╔══╝ ██║ ") + console.print(" ██", style="bright_magenta", end='') + console.print("╔═══╝ ", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("╔══╝ ", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow") # line 6 - console.print(" ██║ ███████╗╚██████╔╝╚██████╔╝███████╗ ██║ ") + console.print(" ██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow", end='') + console.print("███████", style="bright_magenta", end='') + console.print("╗╚", style="bright_yellow", end='') + console.print("██████", style="bright_magenta", end='') + console.print("╔╝╚", style="bright_yellow", end='') + console.print("██████", style="bright_magenta", end='') + console.print("╔╝", style="bright_yellow", end='') + console.print("███████", style="bright_magenta", end='') + console.print("╗ ", style="bright_yellow", end='') + console.print("██", style="bright_magenta", end='') + console.print("║ ", style="bright_yellow") # line 7 console.print(" ╚═╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ", style="bright_yellow") - - - console.print(" ┌────────────────────────────────────┐", style="bright_black") - #print(" │ [" + oColors.brightMagenta + "By Neocky" +oColors.brightBlack + - # "] │ " + oColors.standardWhite) - #print(oColors.brightBlack + " │ " + oColors.brightMagenta + "https://github.com/Neocky/pluGET" + oColors.brightBlack + - # " │ " + oColors.standardWhite) - #print(oColors.brightBlack + " └────────────────────────────────────┘" + oColors.standardWhite) + # line 8 + console.print() + # line 9 + console.print(" ┌────────────────────────────────────┐", style="bright_black") + # line 10 + console.print(" │ [", style="bright_black", end='') + console.print("By Neocky", style="bright_magenta", end='') + console.print("] │ ", style="bright_black") + # line 11 + console.print(" │ ", style="bright_black", end='') + console.print("https://github.com/Neocky/pluGET", style="link https://github.com/Neocky/pluGET", end='') + console.print(" │ ", style="bright_black") + # line 12 + console.print(" └────────────────────────────────────┘", style="bright_black") + console.print(" ───────────────────────────────────────────────────")