INNER CODE UNIT · Python
create_properties
intermine/intermine · config/lib/install_intermine.py:67
def create_properties(
self, filename: str, replacement_dict: dict[str, Any]
) -> None:
for properties_in in glob.glob(
f"**/{filename}.in", root_dir=self.checkout, recursive=True
):
path_in = os.path.join(self.checkout, properties_in)
path_out = path_in[:-3]
with open(path_out, "w") as f_out:
f_out.write(
"# FILE AUTOMATICALLY GENERATED FROM "
f"{properties_in}. DO NOT EDIT!\n"
)
with open(path_in) as f_in:
for line in f_in:
for key, value in replacement_dict.items():
line = line.replace(f"@@{key}@@", value)
f_out.write(line)