Commit f7099ef9 authored by Rohit Gupta's avatar Rohit Gupta
Browse files

fixed a bug in search/replace python script

parent 75e6b8bf
...@@ -22,12 +22,12 @@ if keyword == 'mme_ip_address': ...@@ -22,12 +22,12 @@ if keyword == 'mme_ip_address':
#string = (re.sub(r"mme_ip_address\s*=\s*\([^\$]+)\)\s*;\s*", r"<% tex \1 %>", t, re.M) #string = (re.sub(r"mme_ip_address\s*=\s*\([^\$]+)\)\s*;\s*", r"<% tex \1 %>", t, re.M)
replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; ' replacement_text = keyword + ' = ( { ' + replacement_text + ' } ) ; '
string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
elif keyword == 'N_RB_DL': else :
replacement_text = keyword + ' = ' + replacement_text + ' ; ' replacement_text = keyword + ' = ' + replacement_text + ' ; '
string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M) string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M)
else : #else :
replacement_text = keyword + ' = \" ' + replacement_text + '\" ; ' # replacement_text = keyword + ' =\"' + replacement_text + '\" ; '
string = re.sub(r"%s\s*=\s*\"([^\$]+?)\"\s*;" % keyword , replacement_text, string, re.M) # string = re.sub(r"%s\s*=\s*\"([^\$]+?)\"\s*;" % keyword , replacement_text, string, re.M)
file = open(filename, 'w') file = open(filename, 'w')
file.write(string) file.write(string)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment