diff --git a/__main__.py b/__main__.py index ce7bf14..c2f4a8c 100644 --- a/__main__.py +++ b/__main__.py @@ -1,7 +1,9 @@ from sys import argv -from loader import * +from game import * +from colorama import init def main(): + init() if len(argv)<2: print("You need to specify a path to a YAML file") exit(1) diff --git a/loader.py b/game.py similarity index 86% rename from loader.py rename to game.py index 85bff09..4e0398e 100644 --- a/loader.py +++ b/game.py @@ -1,5 +1,6 @@ import yaml from yaml.loader import SafeLoader +from colorama import Fore, Back, Style class Game: def __init__(self,name:str,author:str,game:dict): @@ -36,6 +37,12 @@ class Game: isWrong = self.make_selection(sel) self.printme() + def parse_colors(self,text:str) -> str: + ''' + Used to convert color codes in string to colors from the colorama lib + ''' + return text.replace("&b",Fore.CYAN) + def load(file_path): '''Loads the game from a YAML file to a Game class''' diff --git a/requirements.txt b/requirements.txt index ef9e486..026bf62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -pyyaml==6.0 \ No newline at end of file +pyyaml==6.0 +colorama==0.4.4 \ No newline at end of file