mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Adding missing call to topdown=True in Generator.get_files
This commit is contained in:
parent
643bccc497
commit
e092f7ca75
2 changed files with 6 additions and 7 deletions
|
|
@ -155,16 +155,15 @@ class Generator(object):
|
||||||
|
|
||||||
if os.path.isdir(root):
|
if os.path.isdir(root):
|
||||||
for dirpath, dirs, temp_files in os.walk(
|
for dirpath, dirs, temp_files in os.walk(
|
||||||
root, followlinks=True):
|
root, topdown=True, followlinks=True):
|
||||||
drop = []
|
|
||||||
excl = exclusions_by_dirpath.get(dirpath, ())
|
excl = exclusions_by_dirpath.get(dirpath, ())
|
||||||
for d in dirs:
|
# We copy the `dirs` list as we will modify it in the loop:
|
||||||
|
for d in list(dirs):
|
||||||
if (d in excl or
|
if (d in excl or
|
||||||
any(fnmatch.fnmatch(d, ignore)
|
any(fnmatch.fnmatch(d, ignore)
|
||||||
for ignore in ignores)):
|
for ignore in ignores)):
|
||||||
drop.append(d)
|
if d in dirs:
|
||||||
for d in drop:
|
dirs.remove(d)
|
||||||
dirs.remove(d)
|
|
||||||
|
|
||||||
reldir = os.path.relpath(dirpath, self.path)
|
reldir = os.path.relpath(dirpath, self.path)
|
||||||
for f in temp_files:
|
for f in temp_files:
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ class LogCountHandler(BufferingHandler):
|
||||||
"""Capturing and counting logged messages."""
|
"""Capturing and counting logged messages."""
|
||||||
|
|
||||||
def __init__(self, capacity=1000):
|
def __init__(self, capacity=1000):
|
||||||
logging.handlers.BufferingHandler.__init__(self, capacity)
|
super(LogCountHandler, self).__init__(capacity)
|
||||||
|
|
||||||
def count_logs(self, msg=None, level=None):
|
def count_logs(self, msg=None, level=None):
|
||||||
return len([
|
return len([
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue