Closed retr0h closed 6 years ago
Is there a way merge strategy can be applied to include? When executing the following code:
import anyconfig f1 = anyconfig.load("a.yml", ac_template=True) f2 = anyconfig.load("b.yml", ac_template=True) anyconfig.merge(f1, f2, ac_merge=anyconfig.MS_DICTS) print f1
--- {% include 'included.yml' %} a: 1 b: - c: 3 d: e: "bbb"
---
b: - c: 0 - c: 2 d: e: "aaa" f: 3
The result should be:
{'a': 1, 'b': [{'c': 3}], 'd': {'e': "bbb", 'f': 3}}
However, the result is:
{'a': 1, 'b': [{ 'c': 3}], 'd': {'e': 'bbb'}}
I don't think it's possible because templates are rendered before load and it cannot be changed because templates may not be valid format, e.g. YAML in this case.
Related: #49
@ssato thanks!
Is there a way merge strategy can be applied to include? When executing the following code:
a.yml
b.yml
included.yml
The result should be:
{'a': 1, 'b': [{'c': 3}], 'd': {'e': "bbb", 'f': 3}}
However, the result is:
{'a': 1, 'b': [{ 'c': 3}], 'd': {'e': 'bbb'}}