mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
readers: Add debugging logging to read_file
This commit is contained in:
parent
ecf5682930
commit
4e118eff01
1 changed files with 5 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals, print_function
|
from __future__ import unicode_literals, print_function
|
||||||
|
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
try:
|
try:
|
||||||
|
|
@ -35,6 +36,8 @@ from pelican.contents import Page, Category, Tag, Author
|
||||||
from pelican.utils import get_date, pelican_open
|
from pelican.utils import get_date, pelican_open
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
METADATA_PROCESSORS = {
|
METADATA_PROCESSORS = {
|
||||||
'tags': lambda x, y: [Tag(tag, y) for tag in x.split(',')],
|
'tags': lambda x, y: [Tag(tag, y) for tag in x.split(',')],
|
||||||
'date': lambda x, y: get_date(x),
|
'date': lambda x, y: get_date(x),
|
||||||
|
|
@ -343,6 +346,8 @@ def read_file(base_path, path, content_class=Page, fmt=None,
|
||||||
path = os.path.abspath(os.path.join(base_path, path))
|
path = os.path.abspath(os.path.join(base_path, path))
|
||||||
source_path = os.path.relpath(path, base_path)
|
source_path = os.path.relpath(path, base_path)
|
||||||
base, ext = os.path.splitext(os.path.basename(path))
|
base, ext = os.path.splitext(os.path.basename(path))
|
||||||
|
logger.debug('read file {} -> {}'.format(
|
||||||
|
source_path, content_class.__name__))
|
||||||
if not fmt:
|
if not fmt:
|
||||||
fmt = ext[1:]
|
fmt = ext[1:]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue