Skip to content

Commit

Permalink
Merge pull request #449 from timgraham/447
Browse files Browse the repository at this point in the history
Fixed #447 -- Fixed zipped versions of the docs after pathlib migration.
  • Loading branch information
jezdez committed Apr 15, 2015
2 parents e2d0743 + eead24b commit 6a42c21
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/management/commands/update_docs.py
Expand Up @@ -122,14 +122,15 @@ def handle_noargs(self, **kwargs):
self.stdout.write(" build zip (into %s)" % zipfile_path)

def zipfile_inclusion_filter(file_path):
file_path = Path(file_path)
return file_path.is_file() and '.doctrees' not in file_path.parts
return '.doctrees' not in file_path.parts

with closing(zipfile.ZipFile(str(zipfile_path), 'w', compression=zipfile.ZIP_DEFLATED)) as zf:
for root, dirs, files in os.walk(str(html_build_dir)):
for f in files:
if zipfile_inclusion_filter(f):
zf.write(os.path.join(root, f), Path(f).relative_to(html_build_dir))
file_path = Path(os.path.join(root, f))
if zipfile_inclusion_filter(file_path):
rel_path = str(file_path.relative_to(html_build_dir))
zf.write(str(file_path), rel_path)

#
# Copy the build results to the directory used for serving
Expand Down

0 comments on commit 6a42c21

Please sign in to comment.