forked from github/pelican
check IGNORE_FILES on get_files
This commit is contained in:
parent
0dc20329a4
commit
7fadbd682a
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