Mercurial > public > mercurial-scm > hg
view mercurial/configuration/__init__.py @ 52425:3e79ca017157
config: gather constant and type into the `__init__.py`
This will help using them in multiple files.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 23 Oct 2024 00:43:17 +0200 |
parents | 0a81f3ef054c |
children | 22129ce9f86d |
line wrap: on
line source
# configuration related constants from __future__ import annotations from typing import ( List, Tuple, Union, ) # keep typing simple for now ConfigLevelT = str LEVEL_USER = 'user' # "user" is the default level and never passed explicitly LEVEL_LOCAL = 'local' LEVEL_GLOBAL = 'global' LEVEL_SHARED = 'shared' LEVEL_NON_SHARED = 'non_shared' EDIT_LEVELS = ( LEVEL_USER, LEVEL_LOCAL, LEVEL_GLOBAL, LEVEL_SHARED, LEVEL_NON_SHARED, ) ConfigItemT = Tuple[bytes, bytes, bytes, bytes] ResourceIDT = Tuple[bytes, bytes] FileRCT = bytes ComponentT = Tuple[ bytes, Union[ List[ConfigItemT], FileRCT, ResourceIDT, ], ]