Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/__init__.py @ 175:327032bb0f6b
Docu: wording
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Fri, 26 Apr 2019 18:27:53 +0200 |
| parents | e2505f524ab9 |
| children | 6dde1e344ae8 |
comparison
equal
deleted
inserted
replaced
| 174:e2505f524ab9 | 175:327032bb0f6b |
|---|---|
| 174 else: | 174 else: |
| 175 raise KeyError("No loader for pattern %r" % pattern) | 175 raise KeyError("No loader for pattern %r" % pattern) |
| 176 | 176 |
| 177 | 177 |
| 178 def set_loader(fnpattern, loader): | 178 def set_loader(fnpattern, loader): |
| 179 """Associate a :mod:`fnmatch` pattern `fnpattern` with a callable | 179 """Associate a :mod:`fnmatch` style pattern `fnpattern` with a |
| 180 `loader` that will be called when :func:`load` encounters a file | 180 callable `loader` that will be called when :func:`load` encounters |
| 181 argument that matches `fnpattern`. | 181 a file argument that matches `fnpattern`. |
| 182 | 182 |
| 183 :param str fnpattern: the :mod:`fnmatch` pattern to associate a loader with | 183 :param str fnpattern: the :mod:`fnmatch` pattern to associate a loader with |
| 184 :param callable loader: a callable that accepts a `filename` argument and | 184 :param callable loader: a callable that accepts a `filename` argument and |
| 185 returns a parsed configuration from a given file | 185 returns a parsed configuration from a given file |
| 186 | 186 |
| 187 This function prepends to the given pattern to the currently defined | 187 This function prepends to the given pattern to the currently defined |
| 188 associations. | 188 associations. |
| 189 | 189 |
| 190 The OS specific case-sensitivity behaviour of | 190 The OS specific case-sensitivity behaviour of |
| 191 :func:`fnmatch.fnmatch` apply (i.e. :func:`os.path.normpath` will | 191 :func:`fnmatch.fnmatch` applies (i.e. :func:`os.path.normpath` |
| 192 be called for both arguments). | 192 will be called for both arguments). |
| 193 | 193 |
| 194 If `loader` is :data:`DEFAULT_LOADER` then the default association | 194 If `loader` is :data:`DEFAULT_LOADER` then the default association |
| 195 from :data:`_default_loaders` will be used -- if any. | 195 from :data:`_default_loaders` will be used -- if any. |
| 196 | 196 |
| 197 """ | 197 """ |
