Commit c6bc990a by sikang

update script

parent a6193e58
......@@ -95,9 +95,13 @@ class Function:
file_content = f.read()
for key in dict.keys():
info = re.compile(r''+key+"=(.*)\n")
targetLine = info.search(file_content).group()
newLine = "%s=%s\n" % (key, dict[key])
replace_line[targetLine] = newLine
result = info.search(file_content)
if result is not None:
targetLine = result.group()
newLine = "%s=%s\n" % (key, dict[key])
replace_line[targetLine] = newLine
else:
print("%s 字段不存在 !!!"%key)
for key in replace_line.keys():
print(replace_line[key].replace("\n", ""))
file_content = file_content.replace(key, replace_line[key])
......
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