Skip to content
Permalink
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
#!/usr/bin/python3
import os
import subprocess
import zipfile
zipname = 'build/from-python-import-better.zip'
subprocess.check_call(['tox', '-e', 'pdf', '-e', 'epub', '-e', 'html'])
if os.path.exists(zipname):
os.remove(zipname)
with zipfile.ZipFile(zipname, 'w') as zipf:
zipf.write('build/tox/epub/tmp/html/frompythonimportbetter.epub', 'from-python-import-better.epub')
zipf.write('build/tox/pdf/tmp/tex/frompythonimportbetter.pdf',
'from-python-import-better.pdf')
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.