mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1144 from idning/master
Check IGNORE_FILES on get_files. Closes #1130.
This commit is contained in:
commit
f4e78d7254
1 changed files with 7 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ import math
|
|||
import random
|
||||
import logging
|
||||
import shutil
|
||||
import fnmatch
|
||||
|
||||
from codecs import open
|
||||
from collections import defaultdict
|
||||
|
|
@ -96,6 +97,12 @@ class Generator(object):
|
|||
if extensions is None:
|
||||
extensions = tuple(self.readers.extensions)
|
||||
basename = os.path.basename(path)
|
||||
|
||||
#check IGNORE_FILES
|
||||
ignores = self.settings['IGNORE_FILES']
|
||||
if any(fnmatch.fnmatch(basename, ignore) for ignore in ignores):
|
||||
return False
|
||||
|
||||
if extensions is False or basename.endswith(extensions):
|
||||
return True
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue