From 0bbdc6bc00b1048e9013ff65d63d738331fdb1e7 Mon Sep 17 00:00:00 2001 From: derdon Date: Sun, 15 May 2011 12:14:03 +0200 Subject: [PATCH] check also the theme dir in autoreload mode --- pelican/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 74bb1058..c301a925 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -140,7 +140,13 @@ def main(): if args.autoreload: while True: try: - if files_changed(pelican.path, pelican.markup): + # Check source dir for changed files ending with the given + # extension in the settings. In the theme dir is no such + # restriction; all files are recursively checked if they + # have changed, no matter what extension the filenames + # have. + if files_changed(pelican.path, pelican.markup) or \ + files_changed(pelican.theme, ['']): pelican.run() time.sleep(.5) # sleep to avoid cpu load except KeyboardInterrupt: