Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (18 sloc) 763 Bytes
import os
import subprocess
import zipfile
zipname = 'build/'
subprocess.check_call(['tox', '-e', 'pdf', '-e', 'epub', '-e', 'html'])
if os.path.exists(zipname):
with zipfile.ZipFile(zipname, 'w') as zipf:
zipf.write('build/tox/epub/tmp/html/frompythonimportbetter.epub', 'from-python-import-better.epub')
html = 'build/tox/html/tmp/html'
for root, dirs, files in os.walk(html):
for file in files:
fname = os.path.join(root, file)
relname = os.path.join('html', os.path.relpath(fname, html))
zipf.write(fname, relname)
You can’t perform that action at this time.