__init__.py
46 lines
| 929 B
| text/x-python
|
PythonLexer
r53322 | # configuration related constants | |||
from __future__ import annotations | ||||
from typing import ( | ||||
List, | ||||
Tuple, | ||||
Union, | ||||
) | ||||
# keep typing simple for now | ||||
ConfigLevelT = str | ||||
r53323 | LEVEL_BUNDLED_RESOURCE = 'RESOURCE' | |||
LEVEL_ENV_OVERWRITE = 'ENV-HGRCPATH' | ||||
LEVEL_USER = 'user' | ||||
r53322 | LEVEL_LOCAL = 'local' | |||
LEVEL_GLOBAL = 'global' | ||||
LEVEL_SHARED = 'shared' | ||||
LEVEL_NON_SHARED = 'non_shared' | ||||
r53323 | # only include level that it make sense to edit | |||
# note: "user" is the default level and never passed explicitly | ||||
r53322 | EDIT_LEVELS = ( | |||
LEVEL_USER, | ||||
LEVEL_LOCAL, | ||||
LEVEL_GLOBAL, | ||||
LEVEL_SHARED, | ||||
LEVEL_NON_SHARED, | ||||
) | ||||
r53324 | # levels that can works without a repository | |||
NO_REPO_EDIT_LEVELS = ( | ||||
LEVEL_USER, | ||||
LEVEL_GLOBAL, | ||||
) | ||||
r53322 | ||||
ConfigItemT = Tuple[bytes, bytes, bytes, bytes] | ||||
ResourceIDT = Tuple[bytes, bytes] | ||||
FileRCT = bytes | ||||
ComponentT = Tuple[ | ||||
r53323 | ConfigLevelT, | |||
r53322 | bytes, | |||
Union[ | ||||
List[ConfigItemT], | ||||
FileRCT, | ||||
ResourceIDT, | ||||
], | ||||
] | ||||