1
0
Fork 0
forked from github/pelican

Cleanup imports

This commit is contained in:
Jake Howard 2023-08-15 17:49:58 +01:00 committed by Deniz Turgut
commit 631ac1bdb3
No known key found for this signature in database
GPG key ID: 87B7168D7AB3ED2F
3 changed files with 5 additions and 7 deletions

View file

@ -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:

View file

@ -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)

View file

@ -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
))