mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-11 08:27:50 -04:00
print better log for couldn't open one of xml files
This commit is contained in:
parent
38ca33dd29
commit
d8977e01e8
@ -341,32 +341,33 @@ def step_update_xml_nodes(jsdata, **options):
|
|||||||
# rename settings.SliderPreference node in res/xml/preferences.xml
|
# rename settings.SliderPreference node in res/xml/preferences.xml
|
||||||
preferences_xml = os.path.join(ANDROID_PATH, 'res', 'xml',
|
preferences_xml = os.path.join(ANDROID_PATH, 'res', 'xml',
|
||||||
'preferences.xml')
|
'preferences.xml')
|
||||||
if os.path.isfile(preferences_xml):
|
try:
|
||||||
soup = BeautifulSoup(open(preferences_xml, 'r'),
|
soup = BeautifulSoup(open(preferences_xml, 'r'),
|
||||||
'xml', from_encoding='utf-8')
|
'xml', from_encoding='utf-8')
|
||||||
item = soup.find('org.kiwix.kiwixmobile.views.SliderPreference')
|
item = soup.find('org.kiwix.kiwixmobile.views.SliderPreference')
|
||||||
item.name = '{}.views.SliderPreference'.format(jsdata.get('package'))
|
item.name = '{}.views.SliderPreference'.format(jsdata.get('package'))
|
||||||
flushxml(soup, 'PreferenceScreen', preferences_xml, head=False)
|
flushxml(soup, 'PreferenceScreen', preferences_xml, head=False)
|
||||||
|
|
||||||
# rename settings.CustomSwitchPreference node in res/xml/preferences.xml
|
# rename settings.CustomSwitchPreference node in res/xml/preferences.xml
|
||||||
preferences_xml = os.path.join(ANDROID_PATH, 'res', 'xml',
|
preferences_xml = os.path.join(ANDROID_PATH, 'res', 'xml',
|
||||||
'preferences.xml')
|
'preferences.xml')
|
||||||
if os.path.isfile(preferences_xml):
|
|
||||||
soup = BeautifulSoup(open(preferences_xml, 'r'),
|
soup = BeautifulSoup(open(preferences_xml, 'r'),
|
||||||
'xml', from_encoding='utf-8')
|
'xml', from_encoding='utf-8')
|
||||||
for item in soup.findAll('org.kiwix.kiwixmobile.settings.CustomSwitchPreference'):
|
for item in soup.findAll('org.kiwix.kiwixmobile.settings.CustomSwitchPreference'):
|
||||||
item.name = '{}.settings.CustomSwitchPreference'.format(jsdata.get('package'))
|
item.name = '{}.settings.CustomSwitchPreference'.format(jsdata.get('package'))
|
||||||
flushxml(soup, 'PreferenceScreen', preferences_xml, head=False)
|
flushxml(soup, 'PreferenceScreen', preferences_xml, head=False)
|
||||||
|
|
||||||
# rename AnimatedProgressBar node in res/layout/toolbar.xml
|
# rename AnimatedProgressBar node in res/layout/toolbar.xml
|
||||||
toolbar_xml = os.path.join(ANDROID_PATH, 'res', 'layout', 'toolbar.xml')
|
toolbar_xml = os.path.join(ANDROID_PATH, 'res', 'layout', 'toolbar.xml')
|
||||||
if os.path.isfile(toolbar_xml):
|
|
||||||
soup = BeautifulSoup(open(toolbar_xml, 'r'),
|
soup = BeautifulSoup(open(toolbar_xml, 'r'),
|
||||||
'xml', from_encoding='utf-8')
|
'xml', from_encoding='utf-8')
|
||||||
item = soup.find('org.kiwix.kiwixmobile.views.AnimatedProgressBar')
|
item = soup.find('org.kiwix.kiwixmobile.views.AnimatedProgressBar')
|
||||||
item.name = '{}.views.AnimatedProgressBar'.format(jsdata.get('package'))
|
item.name = '{}.views.AnimatedProgressBar'.format(jsdata.get('package'))
|
||||||
flushxml(soup, 'RelativeLayout', toolbar_xml, head=False)
|
flushxml(soup, 'RelativeLayout', toolbar_xml, head=False)
|
||||||
|
|
||||||
|
except:
|
||||||
|
logger.error('BeautifulSoup could not open file in res/xml')
|
||||||
|
|
||||||
|
|
||||||
def step_update_gradle(jsdata, **options):
|
def step_update_gradle(jsdata, **options):
|
||||||
""" uncomment compiling the content-libs.jar file into the APK """
|
""" uncomment compiling the content-libs.jar file into the APK """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user