27 lines
820 B
Python
27 lines
820 B
Python
from collections.abc import Mapping
|
|
from pathlib import Path
|
|
|
|
type nested_list = list[str | nested_list]
|
|
type T_Primitive = bool | int | str
|
|
type T_PrimVal = T_Primitive | list[T_Primitive] | T_PrimDict
|
|
type T_PrimDict = Mapping[T_Primitive, T_PrimVal]
|
|
type T_YamlVals = T_Primitive | list[T_Primitive | T_YamlDict] | T_YamlDict
|
|
type T_YamlDict = Mapping[str, T_YamlVals]
|
|
|
|
CFG_ROOT = Path("/data/cfg")
|
|
DATA_ROOT = Path("/data")
|
|
TRAEFIK_PATH = Path("/data/traefik")
|
|
|
|
# TCo_YamlVals = TypeVar(
|
|
# "TCo_YamlVals",
|
|
# bound=T_Primitive | list[T_Primitive | T_YamlDict] | T_YamlDict,
|
|
# covariant=True,
|
|
# )
|
|
# type TCo_YamlDict = dict[str, TCo_YamlVals]
|
|
|
|
# TCo_YamlDict = TypeVar("TCo_YamlDict", bound=dict[str, T_YamlVals], covariant=True)
|
|
|
|
|
|
# class HasServices(TypedDict):
|
|
# services: dict[str, ComposeService]
|