mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
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:
parent
7459891921
commit
98ab9fa94f
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user