mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
Nongreedy matches for retrieve_string
This commit is contained in:
parent
d0e0404bc9
commit
b53dd5708a
1 changed files with 2 additions and 2 deletions
|
|
@ -470,14 +470,14 @@ class vcs_bzr(vcs):
|
||||||
|
|
||||||
def retrieve_string(xml_dir, string):
|
def retrieve_string(xml_dir, string):
|
||||||
if string.startswith('@string/'):
|
if string.startswith('@string/'):
|
||||||
string_search = re.compile(r'.*"'+string[8:]+'".*>([^<]+?)<.*').search
|
string_search = re.compile(r'.*"'+string[8:]+'".*?>([^<]+?)<.*').search
|
||||||
for xmlfile in glob.glob(os.path.join(xml_dir, '*.xml')):
|
for xmlfile in glob.glob(os.path.join(xml_dir, '*.xml')):
|
||||||
for line in file(xmlfile):
|
for line in file(xmlfile):
|
||||||
matches = string_search(line)
|
matches = string_search(line)
|
||||||
if matches:
|
if matches:
|
||||||
return retrieve_string(xml_dir, matches.group(1))
|
return retrieve_string(xml_dir, matches.group(1))
|
||||||
elif string.startswith('&') and string.endswith(';'):
|
elif string.startswith('&') and string.endswith(';'):
|
||||||
string_search = re.compile(r'.*<!ENTITY.*'+string[1:-1]+'.*"([^"]+?)".*>').search
|
string_search = re.compile(r'.*<!ENTITY.*'+string[1:-1]+'.*?"([^"]+?)".*>').search
|
||||||
for xmlfile in glob.glob(os.path.join(xml_dir, '*.xml')):
|
for xmlfile in glob.glob(os.path.join(xml_dir, '*.xml')):
|
||||||
for line in file(xmlfile):
|
for line in file(xmlfile):
|
||||||
matches = string_search(line)
|
matches = string_search(line)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue