MSVC builds: Update string replacement util script

This makes the replace-single function make use of the replace-multi
function, that was just added, to ease future maintenance.
This commit is contained in:
Chun-wei Fan 2016-03-11 16:54:39 +08:00
parent 7459891921
commit 98ab9fa94f

View File

@ -32,11 +32,8 @@ def replace_multi(src, dest, replace_items):
replace_dict[re.escape(m.group(0))], line))
def replace(src, dest, instring, outstring):
with open(src, 'r') as s:
with open(dest, 'w') as d:
for line in s:
i = line.replace(instring, outstring)
d.write(i)
replace_item = {instring: outstring}
replace_multi(src, dest, replace_item)
def check_required_args(args, params):
for param in params: