##// END OF EJS Templates
interfaces: mark `completelocalrepository` as a Protocol class...
interfaces: mark `completelocalrepository` as a Protocol class This is just for completeness, since everything else in here is explicitly marked. The *.pyi file generated for this module is unchanged, because this class currently has no methods or attrs of its own (other than `__doc__`). With this, the odyssey of converting the zope interfaces to Protocol classes is complete. There's a little bit of mopping up in making sure the previously converted Protocols use `@abc.abstractmethod` where appropriate, but that can be deferred for now.

File last commit:

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