1
0
Fork 0
forked from github/pelican

Elaborate the warning message when no files are processed by readers. (#2310)

Elaborate warning message when no files are processed by readers
This commit is contained in:
Adrin Jalali 2018-06-22 15:00:21 +02:00 committed by Justin Mayer
commit ee24ad1821

View file

@ -403,6 +403,11 @@ def main():
try:
pelican, settings = get_instance(args)
readers = Readers(settings)
reader_descs = sorted(set(['%s (%s)' %
(type(r).__name__,
', '.join(r.file_extensions))
for r in readers.readers.values()
if r.enabled]))
watchers = {'content': folder_watcher(pelican.path,
readers.extensions,
@ -467,7 +472,10 @@ def main():
', '.join(k for k, v in modified.items() if v)))
if modified['content'] is None:
logger.warning('No valid files found in content.')
logger.warning(
'No valid files found in content for '
+ 'the active readers:\n'
+ '\n'.join(reader_descs))
if modified['theme'] is None:
logger.warning('Empty theme folder. Using `basic` '
@ -490,7 +498,10 @@ def main():
else:
if next(watchers['content']) is None:
logger.warning('No valid files found in content.')
logger.warning(
'No valid files found in content for '
+ 'the active readers:\n'
+ '\n'.join(reader_descs))
if next(watchers['theme']) is None:
logger.warning('Empty theme folder. Using `basic` theme.')