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:
parent
332d9e393b
commit
99b4fbb081
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user