Mercurial > hgrepos > Python > libs > ConfigMix
comparison doc/introduction.rst @ 194:0d8dd58afc44
Docu: Enhanced the custom loader section somewhat
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 03 May 2019 20:21:12 +0200 |
| parents | 70c4f81ac58c |
| children | 28e6c1413947 |
comparison
equal
deleted
inserted
replaced
| 193:70c4f81ac58c | 194:0d8dd58afc44 |
|---|---|
| 358 loader for INI-files:: | 358 loader for INI-files:: |
| 359 | 359 |
| 360 configmix.clear_assoc() | 360 configmix.clear_assoc() |
| 361 configmix.set_assoc("*.cfg", configmix.get_default_assoc("*.ini")) | 361 configmix.set_assoc("*.cfg", configmix.get_default_assoc("*.ini")) |
| 362 | 362 |
| 363 Just a new configuration file style:: | 363 Only a new configuration file style:: |
| 364 | 364 |
| 365 def my_custom_loader(filename): | 365 def my_custom_loader(filename): |
| 366 ... | 366 ... |
| 367 return some_dict_alike | 367 return some_dict_alike |
| 368 | 368 |
| 369 configmix.mode_loaders["myconfmode"] = my_custom_loader | 369 configmix.mode_loaders["myconfmode"] = my_custom_loader |
| 370 configmix.clear_assoc() | 370 configmix.clear_assoc() |
| 371 configmix.set_assoc("*.my.configuration", "myconfmode") | 371 configmix.set_assoc("*.my.configuration", "myconfmode") |
| 372 | |
| 373 If :py:func:`~configmix.clear_assoc` will not be called then just a *new* | |
| 374 configuration file style will be installed. |
