This repository has been archived on 2022-12-03. You can view files and clone it, but cannot push or open issues or pull requests.
texty/__main__.py
2022-03-22 11:22:50 +01:00

25 lines
708 B
Python

from genericpath import isdir
from lib.game import *
from colorama import init, Back, Fore
from os import mkdir, listdir
def main(): # TODO: Maybe a menu for available text games?
init()
if(not isdir("./games")):
mkdir("./games")
games = []
for file in listdir("./games"):
if file.endswith("yml") or file.endswith("yaml"):
# finds available games
try:
# try parsing
g = load(f"./games/{file}")
games.append(g)
except Exception as e:
print(f"{Back.RED}{Fore.RED}An exception has occured while loading {file}:")
print(e)
if __name__ == "__main__":
main()