We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's say I've got some property-like configuration:
server.property1 = ${foo.bar} server.property2 = ${baz}
And I want to add another two properties without resolving existing variables
server.property2 = replacement server.property3 = 100500
overwriting existing ones values. So I wrote following code:
from pyhocon import ConfigFactory from pyhocon import ConfigTree from pyhocon import HOCONConverter config = ConfigFactory.parse_file("server.properties", resolve=False) ConfigTree.put(config,"server.property3","100500") ConfigTree.put(config,"server.property2","replacement") print HOCONConverter.to_properties(config)
And the result is almost good, but it prints out object names:
server.property1 = [ConfigValues: [ConfigSubstitution: foo.bar]] server.property2 = replacement server.property3 = 100500
Is there any way I can get my ${foo.bar} back?
${foo.bar}
The text was updated successfully, but these errors were encountered:
any update on this?
Sorry, something went wrong.
Any updates? It would be great if this could get fixed.
Looks like HOCONConverter.to_hocon(tree) will in fact do the right thing with unresolved references:
HC file:
template { foo : 12 bar : ${unresolved} }
from pyhocon import ConfigFactory, HOCONConverter tree = ConfigFactory.parse_file('test.hc', resolve=False) print(HOCONConverter.to_hocon(tree))
result 'template {\n foo = 12\n bar = ${unresolved}\n}'
darthbear
No branches or pull requests
Let's say I've got some property-like configuration:
And I want to add another two properties without resolving existing variables
overwriting existing ones values.
So I wrote following code:
And the result is almost good, but it prints out object names:
Is there any way I can get my
${foo.bar}
back?The text was updated successfully, but these errors were encountered: