Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/__init__.py @ 265:39c379fa8c65
FIX: Check the return value when calling only when the callable has been really called.
Now the association mapping of filename to file modes follows really the
documentation.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 10 Sep 2020 01:09:16 +0200 |
| parents | f62764292b9d |
| children | 46571485b7d4 |
comparison
equal
deleted
inserted
replaced
| 264:1a4dae6bd967 | 265:39c379fa8c65 |
|---|---|
| 302 """ | 302 """ |
| 303 for p, m in _extensions: | 303 for p, m in _extensions: |
| 304 if fnmatch.fnmatch(filename, p): | 304 if fnmatch.fnmatch(filename, p): |
| 305 if callable(m): | 305 if callable(m): |
| 306 m = m(filename) | 306 m = m(filename) |
| 307 if m is None: | 307 if m is None: |
| 308 continue | 308 continue |
| 309 return mode_loaders[m](filename) | 309 return mode_loaders[m](filename) |
| 310 else: | 310 else: |
| 311 raise ValueError("Unknown configuration file type for filename " | 311 raise ValueError("Unknown configuration file type for filename " |
| 312 "%r" % filename) | 312 "%r" % filename) |
| 313 | 313 |
