Use a ResourceManager to find assets

This commit is contained in:
Yohann D'ANELLO
2020-11-19 02:49:59 +01:00
parent d92a5e1629
commit 00f843754a
5 changed files with 21 additions and 4 deletions

View File

@ -0,0 +1,13 @@
from pathlib import Path
class ResourceManager:
"""
The ResourceManager loads resources at their right place,
and stores files in config directory.
"""
BASE_DIR = Path(__file__).resolve().parent / 'assets'
@classmethod
def get_asset_path(cls, filename: str) -> str:
return str(cls.BASE_DIR / filename)