Added OS independent installer and finished console output

This commit is contained in:
Neocky
2022-06-04 16:33:46 +02:00
parent 4920689f0e
commit 8e51b1976d
8 changed files with 88 additions and 65 deletions

View File

@@ -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...")

View File

@@ -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(" ───────────────────────────────────────────────────")