INNER CODE UNIT · Python
perform_include_changes
HyperionGameTech/HyperionEngine · Tools/Scripts/Misc/rename_files.py:124
def perform_include_changes(to_rename: 'dict[str, Path]', include_changes: 'dict[str, dict[int, tuple[str, str]]]'):
for key in to_rename:
print("rename {} -> {}".format(key, to_rename[key]))
f = open(key, 'r')
out_file = open(str(to_rename[key]) + '.tmp', 'w')
if key in include_changes:
# make all include changes
line_num = 0
for line in f.readlines():
if line_num in include_changes[key]:
out_file.write(include_changes[key][line_num][1])
else:
out_file.write(line)