Hi Andi,
Firstly, thanks for the feedback!
On 05/04/2019 04:39, 'andi' via pylons-discuss wrote:
> I tried `configurator[yaml]` to get around the Python-package limitation of `tzf.pyramid_yml`. Loading of explicit files works well, but merging configuration of multiple files seems not as smooth as with `tzf.pyramid_yml`.
>
> I.e. having a nested structure in `file_1.yaml` and only one override of a key in the nested structure of `file_2.yaml` will not merge and resolve properly:
> ```
> # file_1.yaml
> logging:
> version: 1
> disable_existing_loggers: false
> root:
> handlers:
> - console
> level: DEBUG
>
> # file_2.yaml
> logging.root.level: INFO
> ```
Can you show me your example code? This works for me:
>>> from configurator import Config
>>> file_1 = Config.from_text("""
... logging:
... version: 1
... disable_existing_loggers: false
... root:
... handlers:
... - console
... level: DEBUG
... """, 'yaml')
>>> file_2 = Config.from_text('{"logging": {"root": {"level":
"INFO"}}}', 'yaml')
>>> file_1+file_2
configurator.config.Config(
{'logging': {'disable_existing_loggers': False,
'root': {'handlers': ['console'], 'level': 'INFO'},
'version': 1}}
)
> Also it would be nice to have some Pyramid specific documentation.
What would that look like? I'm not sure it belongs in the configurator
package, which is not targeting any particular framework, but I guess I
should be thinking about adding "frameworks" sections?
> One thing here would be to have one snippet how to apply config values to the Pyramid `pyramid.config.Configurator`.
If you're starting with a nested dict of config, what's he current best
practice, from Pyramid's point of view, for applying those to a
Configurator?
> The other interesting point is, what is possible to apply with `configurator` (I believe ` tzf.pyramid_yml` mentioned that some initial Pyramid config values are required in the ini file).
I'm sorry, I'm not sure what this means?
Chris