mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 23:42:37 +03:00
Add an extra strip() to work around tostring issue
In cases like this xml code: <string name="app_name">"OpenKeychain"</string> <!-- title --> <string name="title_encrypt_text">"Encrypt"</string> tostring() returns trailing whitespaces (including newlines). Which aren't removed until the very end, after we try to remove enclosing quotes. So strip right after tostring() too, since we never really care about whitespaces anyway.
This commit is contained in:
parent
995afdcbfd
commit
9017328698
1 changed files with 2 additions and 1 deletions
|
@ -914,7 +914,8 @@ def retrieve_string(app_dir, string, xmlfiles=None):
|
||||||
def element_content(element):
|
def element_content(element):
|
||||||
if element.text is None:
|
if element.text is None:
|
||||||
return ""
|
return ""
|
||||||
return XMLElementTree.tostring(element, encoding='utf-8', method='text')
|
s = XMLElementTree.tostring(element, encoding='utf-8', method='text')
|
||||||
|
return s.strip()
|
||||||
|
|
||||||
for path in xmlfiles:
|
for path in xmlfiles:
|
||||||
if not os.path.isfile(path):
|
if not os.path.isfile(path):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue