Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/config.py @ 485:008b35666a43
Use the new contant _EMPTY_STR where appropriate
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Fri, 17 Dec 2021 15:56:33 +0100 |
| parents | 0259bd521729 |
| children | d7f6f2afcee2 |
comparison
equal
deleted
inserted
replaced
| 484:0259bd521729 | 485:008b35666a43 |
|---|---|
| 782 raise ValueError("quote syntax: length too small") | 782 raise ValueError("quote syntax: length too small") |
| 783 res_append(uchr(int(p[1:9], 16))) | 783 res_append(uchr(int(p[1:9], 16))) |
| 784 res_append(p[9:]) | 784 res_append(p[9:]) |
| 785 else: | 785 else: |
| 786 raise ValueError("unknown quote syntax string: {}".format(s)) | 786 raise ValueError("unknown quote syntax string: {}".format(s)) |
| 787 return ''.join(res) | 787 return klass._EMPTY_STR.join(res) |
| 788 | 788 |
| 789 def jailed(self, rootpath=None, root=None, bind_root=True): | 789 def jailed(self, rootpath=None, root=None, bind_root=True): |
| 790 """Return a "jailed" configuration of the current configuration. | 790 """Return a "jailed" configuration of the current configuration. |
| 791 | 791 |
| 792 :param rootpath: a sequence of strings that shall emcompass | 792 :param rootpath: a sequence of strings that shall emcompass |
| 864 self._pathstr = \ | 864 self._pathstr = \ |
| 865 Configuration._HIER_SEPARATOR.join( | 865 Configuration._HIER_SEPARATOR.join( |
| 866 [Configuration.quote(p) for p in path]) \ | 866 [Configuration.quote(p) for p in path]) \ |
| 867 + Configuration._HIER_SEPARATOR | 867 + Configuration._HIER_SEPARATOR |
| 868 else: | 868 else: |
| 869 self._pathstr = '' | 869 self._pathstr = Configuration._EMPTY_STR |
| 870 | 870 |
| 871 @property | 871 @property |
| 872 def base(self): | 872 def base(self): |
| 873 """Ask for the base (aka parent) configuration". | 873 """Ask for the base (aka parent) configuration". |
| 874 | 874 |
