Commit 36e3d3cb by sikang

update script

parent a712c90c
......@@ -7,11 +7,20 @@ import sys
def getResValue(line):
return line.split(",")[2].replace("'","").replace(" ","").replace(")","").replace("'\n","")
return line.split(",")[2].replace("\\\"","").replace("'","").replace(" ","").replace(")","").replace("'\n","")
def addToProperties(line):
os.system("./update_properties.py "+line)
def getStringFiled(key,value):
return "\t\t\tbuildConfigField 'String', '" + key + "', " + value + "+\n"
def getColorRes(key,value):
return "\t\t\tresValue('color', '"+key+"', " + value + "\n"
def getStringRes(key,value):
return "\t\t\tresValue('string', '"+key+"', " + value + "\n"
def move_config(path):
# print("processing content: %s..." % path)
with open(path, "r", encoding="utf-8") as f:
......@@ -27,16 +36,25 @@ def move_config(path):
if move_finished >1:
break
if "app_name_str" in line:
addToProperties("app_name="+getResValue(line))
line = getStringRes("app_name_str","\"${app_name}\"")
if "LANGUAGE" in line:
if "//" in line:
if line.startswith("//"):
line = ""
else:
addToProperties("language="+getResValue(line))
line = "\t\t\tresValue('color', 'main_color', \"${language}\")\n"
line = getStringFiled("LANGUAGE","\"${language}\"")
if "'color', 'main_color'" in line:
addToProperties("main_color="+getResValue(line))
line = "\t\t\tresValue('color', 'main_color', \"${main_color}\")\n"
line = getColorRes("main_color","\"${main_color}\"")
if "'color', 'main_text_color'" in line:
addToProperties("main_text_color="+getResValue(line))
line = getColorRes("main_text_color","\"${main_text_color}\"")
f_w.write(line)
return
......
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