diff --git a/pelican/__init__.py b/pelican/__init__.py index a4f5b38e..e0526b1f 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -27,7 +27,7 @@ from pelican.plugins._utils import get_plugin_name, load_plugins from pelican.readers import Readers from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer from pelican.settings import read_settings -from pelican.utils import (wait_for_changes, clean_output_dir, maybe_pluralize) +from pelican.utils import clean_output_dir, maybe_pluralize, wait_for_changes from pelican.writers import Writer try: diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 7ff1af7a..d8296285 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -2,7 +2,6 @@ import locale import logging import os import shutil -import time from datetime import timezone from sys import platform from tempfile import mkdtemp @@ -14,7 +13,6 @@ except ModuleNotFoundError: from pelican import utils from pelican.generators import TemplatePagesGenerator -from pelican.readers import Readers from pelican.settings import read_settings from pelican.tests.support import (LoggedTestCase, get_article, locale_available, unittest) diff --git a/pelican/utils.py b/pelican/utils.py index 23c6fe1c..1225e479 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -760,7 +760,9 @@ def order_content(content_list, order_by='slug'): def wait_for_changes(settings_file, reader_class, settings): content_path = settings.get('PATH', '') theme_path = settings.get('THEME', '') - ignore_files = set(settings.get('IGNORE_FILES', [])) + ignore_files = set( + fnmatch.translate(pattern) for pattern in settings.get('IGNORE_FILES', []) + ) watching_paths = [ settings_file, @@ -780,9 +782,7 @@ def wait_for_changes(settings_file, reader_class, settings): return next(watchfiles.watch( *watching_paths, - watch_filter=watchfiles.DefaultFilter( - ignore_entity_patterns=[fnmatch.translate(pattern) for pattern in ignore_files] - ), + watch_filter=watchfiles.DefaultFilter(ignore_entity_patterns=ignore_files), rust_timeout=0 ))