mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
680e04b4a1
12 changed files with 132 additions and 96 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import copy
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
|
@ -11,7 +12,7 @@ from pelican.generators import (ArticlesGenerator, PagesGenerator,
|
|||
StaticGenerator, PdfGenerator, LessCSSGenerator)
|
||||
from pelican.log import init
|
||||
from pelican.settings import read_settings, _DEFAULT_CONFIG
|
||||
from pelican.utils import clean_output_dir, files_changed, file_changed
|
||||
from pelican.utils import clean_output_dir, files_changed, file_changed, NoFilesError
|
||||
from pelican.writers import Writer
|
||||
|
||||
__major__ = 3
|
||||
|
|
@ -29,7 +30,7 @@ class Pelican(object):
|
|||
before doing anything else.
|
||||
"""
|
||||
if settings is None:
|
||||
settings = _DEFAULT_CONFIG
|
||||
settings = copy.deepcopy(_DEFAULT_CONFIG)
|
||||
|
||||
self.path = path or settings['PATH']
|
||||
if not self.path:
|
||||
|
|
@ -267,6 +268,7 @@ def main():
|
|||
|
||||
try:
|
||||
if args.autoreload:
|
||||
files_found_error = True
|
||||
while True:
|
||||
try:
|
||||
# Check source dir for changed files ending with the given
|
||||
|
|
@ -276,6 +278,8 @@ def main():
|
|||
# have.
|
||||
if files_changed(pelican.path, pelican.markup) or \
|
||||
files_changed(pelican.theme, ['']):
|
||||
if files_found_error == False:
|
||||
files_found_error = True
|
||||
pelican.run()
|
||||
|
||||
# reload also if settings.py changed
|
||||
|
|
@ -289,6 +293,10 @@ def main():
|
|||
except KeyboardInterrupt:
|
||||
logger.warning("Keyboard interrupt, quitting.")
|
||||
break
|
||||
except NoFilesError:
|
||||
if files_found_error == True:
|
||||
logger.warning("No valid files found in content. Nothing to generate.")
|
||||
files_found_error = False
|
||||
except Exception, e:
|
||||
logger.warning(
|
||||
"Caught exception \"{}\". Reloading.".format(e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue