1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

implement text.extract_iter

This commit is contained in:
Mike Fährmann 2015-11-28 01:46:34 +01:00
parent 332d9e393b
commit 99b4fbb081
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -99,6 +99,14 @@ def extract_all(txt, rules, pos=0, values=None):
values[key] = result
return values, pos
def extract_iter(txt, begin, end, pos=0):
"""Yield all values obtained by repeated calls to text.extract"""
while True:
value, pos = extract(txt, begin, end, pos)
if value is None:
return
yield value
if platform.system() == "Windows":
clean_path = clean_path_windows
else: