Force the rewriting of all branding.xml files (for custom apps)

This commit is contained in:
Emmanuel Engelhart 2015-06-20 17:49:17 +02:00
parent ef25f8ea16
commit b0bfde2c9d

View File

@ -247,14 +247,16 @@ def step_update_branding_xml(jsdata, **options):
move_to_android_placeholder()
# copy and rewrite res/values/branding.xml
branding_xml = os.path.join(ANDROID_PATH, 'res', 'values', 'branding.xml')
soup = soup = BeautifulSoup(open(branding_xml, 'r'),
'xml', from_encoding='utf-8')
for elem in soup.findAll('string'):
elem.string.replace_with(
elem.text.replace('Kiwix', jsdata.get('app_name')))
flushxml(soup, 'resources', branding_xml)
for root, dirs, files in os.walk(os.path.join(ANDROID_PATH, 'res')):
for file in files:
if file.endswith('branding.xml'):
branding_xml = os.path.join(root, file)
soup = soup = BeautifulSoup(open(branding_xml, 'r'),
'xml', from_encoding='utf-8')
for elem in soup.findAll('string'):
elem.string.replace_with(
elem.text.replace('Kiwix', jsdata.get('app_name')))
flushxml(soup, 'resources', branding_xml)
def step_gen_constants_java(jsdata, **options):
''' gen Java Source class (final constants) with all JSON values '''