Mercurial > hgrepos > Python > libs > ConfigMix
comparison doc/introduction.rst @ 145:d44ee758e31b
Some docu on comments in files
| author | Franz Glasner <hg@dom66.de> |
|---|---|
| date | Fri, 13 Apr 2018 21:44:42 +0200 |
| parents | fc2bd73f9e98 |
| children | ab6a48ff5235 |
comparison
equal
deleted
inserted
replaced
| 144:7e6ec99d5ff5 | 145:d44ee758e31b |
|---|---|
| 43 | 43 |
| 44 .. note:: The root object must be an *object* and therefore decode | 44 .. note:: The root object must be an *object* and therefore decode |
| 45 into a Python :class:`dict` alike. This is checked by the | 45 into a Python :class:`dict` alike. This is checked by the |
| 46 implementation. | 46 implementation. |
| 47 | 47 |
| 48 .. todo:: Handle JSON comments by special attributes which will | |
| 49 filtered out on further processing. Javascript comments are | |
| 50 not allowed by the JSON specification. | |
| 51 | |
| 52 An example is: | 48 An example is: |
| 53 | 49 |
| 54 .. literalinclude:: ../tests/data/conf10.json | 50 .. literalinclude:: ../tests/data/conf10.json |
| 55 :language: js | 51 :language: js |
| 52 | |
| 53 For comments in JSON files see section :ref:`comments`. | |
| 56 | 54 |
| 57 | 55 |
| 58 .. _ini-files: | 56 .. _ini-files: |
| 59 | 57 |
| 60 INI Files | 58 INI Files |
| 201 variable name arguments of :py:meth:`.Configuration.getvar` and | 199 variable name arguments of :py:meth:`.Configuration.getvar` and |
| 202 :py:meth:`.Configuration.getvar_s` are of the form | 200 :py:meth:`.Configuration.getvar_s` are of the form |
| 203 ``[namespace:]variable``. | 201 ``[namespace:]variable``. |
| 204 | 202 |
| 205 | 203 |
| 204 .. _comments: | |
| 205 | |
| 206 Comments | |
| 207 -------- | |
| 208 | |
| 209 By default all keys beginning with ``__comment`` or ``__doc`` are | |
| 210 filtered out and not given to the application. This allows comments in | |
| 211 JSON files -- but is not restricted to JSON files only. | |
| 212 | |
| 213 For all types of configuration files their respective standard comments | |
| 214 are allowed too. | |
| 215 | |
| 216 | |
| 206 .. _variable-namespaces: | 217 .. _variable-namespaces: |
| 207 | 218 |
| 208 Variable Namespaces | 219 Variable Namespaces |
| 209 ------------------- | 220 ------------------- |
| 210 | 221 |
