Mercurial > hgrepos > Python > libs > ConfigMix
changeset 192:46c7d872db83
Changelog: note the latest refactorings
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 03 May 2019 20:04:40 +0200 |
| parents | 8af600d0e5c0 |
| children | 70c4f81ac58c |
| files | CHANGES.txt doc/changes.rst |
| diffstat | 2 files changed, 39 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Fri May 03 19:59:21 2019 +0200 +++ b/CHANGES.txt Fri May 03 20:04:40 2019 +0200 @@ -19,27 +19,38 @@ .. change:: :tags: breaking - The public functions to manage file extensions to file modes have - been renamed to :py:func:`configmix.set_assoc`, - :py:func:`configmix.get_assoc`, :py:func:`clear_assoc`, + Additional or alternative loaders can be installed by changing + the :py:data:`configmix.mode_loaders` dictionary directly. + + .. change:: + :tags: breaking + + The public functions to associate filename extensions to filemodes + have been renamed to :py:func:`configmix.set_assoc`, + :py:func:`configmix.get_assoc`, + :py:func:`configmix.clear_assoc`, :py:func:`configmix.get_default_assoc`. + The filemodes must be keys in the :py:data:`configmix.mode_loaders` + dictionary. + .. change:: :tags: breaking, feature The associations from filename extensions to parsers are :py:mod:`fnmatch` style patterns now. - Calling :py:func:`configmix.set_assoc` prepends to the currently - defined associations and therefore gets the highest priority. + Calling :py:func:`configmix.set_assoc` by default prepends to + the currently defined associations and therefore gets the + highest priority. Appending is possible also. .. change:: :tags: feature - :py:func:`configmix.load` and :py:func:`configmix.safe_load` got a - keyword argument `defaults` that allow the provision of an already - existing default configuration wheter all additional configuration - settings are merged into. + :py:func:`configmix.load` and :py:func:`configmix.safe_load` got + a keyword argument `defaults` that allow the provision of an + already existing default configuration into which all additional + configuration settings are merged into. .. changelog::
--- a/doc/changes.rst Fri May 03 19:59:21 2019 +0200 +++ b/doc/changes.rst Fri May 03 20:04:40 2019 +0200 @@ -1,4 +1,4 @@ -.. -*- coding: utf-8 -*- +.. -*- coding: utf-8; mode: rst; -*- ========= Changes @@ -19,11 +19,24 @@ 0.7 --- -- :py:func:`configmix.set_loader` now requires a :mod:`fnmatch` style - pattern instead of just a file extension string (i.e. a plain trailer). - The previons dictionary with mapping from filename extensions to loader - callables is now a list of tuples containing the :mod:`fnmatch` style - pattern and the corresponding loader callable. +- A major overhowl of how filename extensions are associated with loaders + has been done: + + + Filename extensions in :mod:`fnmatch` style are associated with + file-mode strings. These file-mode strings are associated with loader + functions separately. + + + :py:func:`configmix.set_assoc`, :py:func:`configmix.get_assoc`, + :py:func:`configmix.clear_assoc` and + :py:func:`configmix.get_default_assoc` are the new names for the old + `set_loader()`, `get_loader()`, `clear_loader()` and + `get_default_loader()` functions. + + + :py:func:`configmix.set_assoc` now requires a :mod:`fnmatch` style + pattern instead of just a file extension string (i.e. a plain trailer). + The previons dictionary with mapping from filename extensions to loader + callables is now a list of tuples containing the :mod:`fnmatch` style + pattern and the corresponding loader callable. 0.6
