refactor!: restructure project files and modules
This commit is contained in:
23
tetris/util.py
Normal file
23
tetris/util.py
Normal 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]
|
||||
Reference in New Issue
Block a user