mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
allow adding values to existing dict
This commit is contained in:
parent
629133a27a
commit
d0bebd9ce3
@ -80,8 +80,9 @@ def extract(txt, begin, end, pos=0):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
return None, pos
|
return None, pos
|
||||||
|
|
||||||
def extract_all(txt, rules, pos=0):
|
def extract_all(txt, rules, pos=0, values=None):
|
||||||
"""Calls extract for each rule and returns the result in a dict"""
|
"""Calls extract for each rule and returns the result in a dict"""
|
||||||
|
if values is None:
|
||||||
values = {}
|
values = {}
|
||||||
for key, begin, end in rules:
|
for key, begin, end in rules:
|
||||||
result, pos = extract(txt, begin, end, pos)
|
result, pos = extract(txt, begin, end, pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user