0
0
mirror of https://gitflic.ru/project/maks1ms/ocab.git synced 2024-12-24 00:33:05 +03:00
ocab/src/service.py

26 lines
521 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")