Fix zip files to make sense.
parent
b87a808914
commit
92d14b5fbf
|
@ -11,6 +11,7 @@ media/pdf
|
||||||
media/export
|
media/export
|
||||||
media/man
|
media/man
|
||||||
media/epub
|
media/epub
|
||||||
|
media/htmlzip
|
||||||
xml_output
|
xml_output
|
||||||
locks/*
|
locks/*
|
||||||
readthedocs/rtd_tests/tests/builds
|
readthedocs/rtd_tests/tests/builds
|
||||||
|
|
|
@ -141,6 +141,7 @@ class Builder(BaseBuilder):
|
||||||
self._changed = False
|
self._changed = False
|
||||||
return build_results
|
return build_results
|
||||||
|
|
||||||
|
@restoring_chdir
|
||||||
def _zip_html(self):
|
def _zip_html(self):
|
||||||
from_path = self.version.project.full_build_path(self.version.slug)
|
from_path = self.version.project.full_build_path(self.version.slug)
|
||||||
from_file = os.path.join(from_path, '%s.zip' % self.version.project.slug)
|
from_file = os.path.join(from_path, '%s.zip' % self.version.project.slug)
|
||||||
|
@ -149,8 +150,9 @@ class Builder(BaseBuilder):
|
||||||
|
|
||||||
print "Creating zip file from %s" % from_path
|
print "Creating zip file from %s" % from_path
|
||||||
# Create a <slug>.zip file containing all files in file_path
|
# Create a <slug>.zip file containing all files in file_path
|
||||||
|
os.chdir(from_path)
|
||||||
archive = zipfile.ZipFile(to_file, 'w')
|
archive = zipfile.ZipFile(to_file, 'w')
|
||||||
for root, subfolders, files in os.walk(from_path):
|
for root, subfolders, files in os.walk('.'):
|
||||||
for file in files:
|
for file in files:
|
||||||
archive.write(os.path.join(root, file))
|
archive.write(os.path.join(root, file))
|
||||||
archive.close()
|
archive.close()
|
||||||
|
|
Loading…
Reference in New Issue