Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/config.py @ 432:b96f49c9c76b
Proper "repr()" for a jailed configuration: put the root path into the output
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 09 Dec 2021 22:51:10 +0100 |
| parents | 090a25f36a3d |
| children | bbc5b64e137a |
comparison
equal
deleted
inserted
replaced
| 431:49cadb78c45a | 432:b96f49c9c76b |
|---|---|
| 26 from urllib.parse import urlsplit | 26 from urllib.parse import urlsplit |
| 27 except ImportError: | 27 except ImportError: |
| 28 from urlparse import urlsplit | 28 from urlparse import urlsplit |
| 29 | 29 |
| 30 from .variables import lookup_varns, lookup_filter | 30 from .variables import lookup_varns, lookup_filter |
| 31 from .compat import u, uchr | 31 from .compat import u, uchr, n |
| 32 from .constants import REF_NAMESPACE, NONE_FILTER, EMPTY_FILTER | 32 from .constants import REF_NAMESPACE, NONE_FILTER, EMPTY_FILTER |
| 33 | 33 |
| 34 | 34 |
| 35 _MARKER = object() | 35 _MARKER = object() |
| 36 | 36 |
| 892 new_rootpath = rootpath | 892 new_rootpath = rootpath |
| 893 sjc = _JailedConfiguration(*new_rootpath) | 893 sjc = _JailedConfiguration(*new_rootpath) |
| 894 if bind_root: | 894 if bind_root: |
| 895 sjc.rebind(self._base) | 895 sjc.rebind(self._base) |
| 896 return sjc | 896 return sjc |
| 897 | |
| 898 def __repr__(self): | |
| 899 r = "_JailedConfiguration(rootpath=%s)" % n(repr(self._path)) | |
| 900 return r |
