import xml.etree.ElementTree as ET
color_xml = ori + "app/src/main/res/values/colors.xml"
updateTree = ET.parse(color_xml)
root = updateTree.getroot()
for child in root:
for key in color_value_map:
if child.attrib['name'] == key:
child.text = color_value_map[key]
updateTree.write(color_xml)
网友评论