2023-12-10 19:04:17 +03:00
|
|
|
import os.path
|
|
|
|
from dataclasses import dataclass
|
|
|
|
from json import loads
|
|
|
|
|
2024-01-02 21:26:09 +03:00
|
|
|
|
2023-12-10 19:04:17 +03:00
|
|
|
@dataclass
|
|
|
|
class Path:
|
|
|
|
core: str
|
|
|
|
modules_standard: str
|
|
|
|
modules_custom: str
|
|
|
|
|
|
|
|
def _get_paths(path_to_json: str):
|
|
|
|
with open(path_to_json, encoding="utf8") as f:
|
|
|
|
paths = loads(f.read())
|
|
|
|
return Path(
|
|
|
|
core=paths["core"],
|
|
|
|
modules_standard=paths["modules standard"],
|
|
|
|
modules_custom=paths["modules custom"]
|
|
|
|
)
|
|
|
|
|
2024-01-02 21:26:09 +03:00
|
|
|
|
2023-12-10 19:04:17 +03:00
|
|
|
cwd = os.getcwd()
|
|
|
|
cwd = cwd[:cwd.index('/src')]
|
|
|
|
|
|
|
|
paths = _get_paths(f"{cwd}/paths.json")
|