refactor!: restructure project files and modules

This commit is contained in:
Giovani Rodriguez
2021-06-11 22:48:10 -04:00
parent 1af624ec11
commit 092930b202
12 changed files with 405 additions and 405 deletions

23
tetris/util.py Normal file
View File

@@ -0,0 +1,23 @@
import random
import yaml
from typing import Tuple
"""
TODO description
"""
class ConfigurationManager:
CONFIG_FILE_LOCATION = "config.yaml"
configuration = []
@classmethod
def load(cls) -> None:
with open(cls.CONFIG_FILE_LOCATION, "r") as yaml_file:
cls.configuration = yaml.safe_load(yaml_file)
@classmethod
def get(cls, key: str, sub_key: str = None):
if sub_key:
return cls.configuration[key][sub_key]
else:
return cls.configuration[key]