[glib] MSVC builds: Update string replacement util script



commit 98ab9fa94f926e11a58cb0c1ccc4aaebe5a3b349
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Mar 11 16:54:39 2016 +0800

    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.

 build/win32/replace.py |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/build/win32/replace.py b/build/win32/replace.py
index 7c64b73..a81bab9 100644
--- a/build/win32/replace.py
+++ b/build/win32/replace.py
@@ -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:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]