Closes #1330: Fix :confval:exclude_patterns behavior with subdirectories in the :confval:html_static_path.

This commit is contained in:
Georg Brandl 2014-01-19 18:10:19 +01:00
parent 48aeed6fd8
commit 5dcf03fb2d
2 changed files with 14 additions and 12 deletions

View File

@ -116,6 +116,9 @@ Bugs fixed
* #1283: Fix a bug in the detection of changed files that would try to access * #1283: Fix a bug in the detection of changed files that would try to access
doctrees of deleted documents. doctrees of deleted documents.
* #1330: Fix :confval:`exclude_patterns` behavior with subdirectories in the
:confval:`html_static_path`.
Documentation Documentation
------------- -------------

View File

@ -158,18 +158,17 @@ def copy_static_entry(source, targetdir, builder, context={},
else: else:
copyfile(source, target) copyfile(source, target)
elif path.isdir(source): elif path.isdir(source):
if level == 0: if not path.isdir(targetdir):
for entry in os.listdir(source): os.mkdir(targetdir)
if entry.startswith('.'): for entry in os.listdir(source):
continue if entry.startswith('.'):
copy_static_entry(path.join(source, entry), targetdir, continue
builder, context, level=1, newtarget = targetdir
exclude_matchers=exclude_matchers) if path.isdir(path.join(source, entry)):
else: newtarget = path.join(targetdir, entry)
target = path.join(targetdir, path.basename(source)) copy_static_entry(path.join(source, entry), newtarget,
if path.exists(target): builder, context, level=level+1,
shutil.rmtree(target) exclude_matchers=exclude_matchers)
shutil.copytree(source, target)
_DEBUG_HEADER = '''\ _DEBUG_HEADER = '''\