mirror of
https://gitflic.ru/project/maks1ms/ocab.git
synced 2024-12-25 00:54:42 +03:00
24 lines
519 B
Python
24 lines
519 B
Python
|
import os.path
|
||
|
from dataclasses import dataclass
|
||
|
from json import loads
|
||
|
|
||
|
@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"]
|
||
|
)
|
||
|
|
||
|
cwd = os.getcwd()
|
||
|
cwd = cwd[:cwd.index('/src')]
|
||
|
|
||
|
paths = _get_paths(f"{cwd}/paths.json")
|