pip install -r requirements.txt
python props.py a.properties b.properties c.properties
Last active
November 21, 2016 17:11
-
-
Save mikaelhg/18a68fffa355c663549f6b845d7ad11f to your computer and use it in GitHub Desktop.
Merge properties files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python2 | |
from pyjavaproperties import Properties | |
from sys import argv | |
a, b = Properties(), Properties() | |
with open(argv[1], 'r') as fa, open(argv[2], 'r') as fb: | |
a.load(fa) | |
b.load(fb) | |
for k in a.propertyNames(): | |
b.setProperty(k, a[k]) | |
with open(argv[3], 'wb') as fc: | |
b.store(fc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pyjavaproperties |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment