This commit is contained in:
Auric Vente
2024-07-18 20:10:08 -06:00
parent 685f5bc686
commit fa1f5301ae
18 changed files with 1188 additions and 101 deletions

View File

@@ -1,17 +1,29 @@
from pathlib import Path
import appdirs # type: ignore
class Config:
title = "Cromulant"
width = 800
height = 600
max_ants = 100
here: str
database_path: Path
schema_path: Path
ants_json: Path
icon_path: Path
image_path: Path
names_json: Path
@staticmethod
def prepare() -> None:
Config.here = Path(__file__).parent
Config.database_path = Config.here / "cromulant.db"
Config.schema_path = Config.here / "schema.sql"
Config.ants_json = Path(appdirs.user_data_dir()) / "cromulant" / "ants.json"
if not Config.ants_json.exists():
Config.ants_json.parent.mkdir(parents=True, exist_ok=True)
Config.ants_json.write_text("[]")
Config.icon_path = Config.here / "img" / "icon_4.jpg"
Config.image_path = Config.here / "img" / "icon_7.jpg"
Config.names_json = Config.here / "data" / "names.json"