...
 
Commits (4)
"""Context for examples."""
import os
import sys
sys.path.insert(
0,
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..')
)
)
import namelist
This diff is collapsed.
This diff is collapsed.
from context import namelist
import json
in_file_ref = "namelist_ref"
in_file_cfg = "namelist_cfg"
with open(in_file_ref) as f:
ref_nmls = namelist.parse_namelist_file(f)
with open(in_file_cfg) as f:
cfg_nmls = namelist.parse_namelist_file(f)
nmls = ref_nmls.copy()
for k in cfg_nmls:
if k in nmls:
nmls[k].update(cfg_nmls[k])
else:
nmls[k] = cfg_nmls[k]
print(json.dumps(nmls, indent=4))