MCPcopy Create free account
hub / github.com/cztomczak/cefpython / copy_template_file

Function copy_template_file

tools/make_installer.py:169–178  ·  view source on GitHub ↗

Copy file and replaces template variables in that file.

(src, dst, variables)

Source from the content-addressed store, hash-verified

167
168
169def copy_template_file(src, dst, variables):
170 """Copy file and replaces template variables in that file."""
171 print("[make_installer.py] Copy_t: {src} ==> {dst}"
172 .format(src=short_src_path(src), dst=short_dst_path(dst)))
173 with open(src, "rb") as fo:
174 contents = fo.read().decode("utf-8")
175 contents = replace_template_vars(contents, variables)
176 with open(dst, "wb") as fo:
177 fo.write(contents.encode("utf-8"))
178 return contents
179
180
181def replace_template_vars(string, dictionary):

Callers 1

Calls 3

short_src_pathFunction · 0.85
short_dst_pathFunction · 0.85
replace_template_varsFunction · 0.85

Tested by

no test coverage detected