mirror of
https://github.com/getpelican/pelican.git
synced 2026-05-28 15:58:22 +02:00
adhere to pep8
This commit is contained in:
parent
7024fe1192
commit
e061f2756e
1 changed files with 3 additions and 3 deletions
|
|
@ -369,6 +369,7 @@ def read_file(path, fmt=None, settings=None):
|
|||
|
||||
return content, metadata
|
||||
|
||||
|
||||
def parse_path_metadata(path, settings=None, process=None):
|
||||
"""Extract a metadata dictionary from a file's path
|
||||
|
||||
|
|
@ -391,9 +392,8 @@ def parse_path_metadata(path, settings=None, process=None):
|
|||
metadata = {}
|
||||
base, ext = os.path.splitext(os.path.basename(path))
|
||||
if settings:
|
||||
for key,data in [('FILENAME_METADATA', base),
|
||||
('PATH_METADATA', path),
|
||||
]:
|
||||
items = [('FILENAME_METADATA', base), ('PATH_METADATA', path), ]
|
||||
for key, data in items:
|
||||
regexp = settings.get(key)
|
||||
if regexp:
|
||||
match = re.match(regexp, data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue