mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-23 15:49:16 +02: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))
|
replace_dict[re.escape(m.group(0))], line))
|
||||||
|
|
||||||
def replace(src, dest, instring, outstring):
|
def replace(src, dest, instring, outstring):
|
||||||
with open(src, 'r') as s:
|
replace_item = {instring: outstring}
|
||||||
with open(dest, 'w') as d:
|
replace_multi(src, dest, replace_item)
|
||||||
for line in s:
|
|
||||||
i = line.replace(instring, outstring)
|
|
||||||
d.write(i)
|
|
||||||
|
|
||||||
def check_required_args(args, params):
|
def check_required_args(args, params):
|
||||||
for param in params:
|
for param in params:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user