aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmake_guides.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/make_guides.py b/make_guides.py
index d55d8e5..d46ba13 100755
--- a/make_guides.py
+++ b/make_guides.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-import argparse, os
+import argparse, os, shutil
import docutils.core
def basename(fname):
@@ -85,12 +85,22 @@ def build_pdf(guide):
return None
except OSError:
pass
- # DEBUG
- print('Building PDF...')
if not os.path.isdir(dist_dir):
os.mkdir(dist_dir)
- fp = open(os.path.join(dist_dir,pdf_name),'w')
- fp.close()
+ os.chdir(build_dir)
+ try:
+ if os.system('pdflatex '+tex_name) == 0:
+ if os.system('pdflatex '+tex_name) == 0:
+ os.system('pdflatex '+tex_name)
+ except OSError:
+ return False
+ finally:
+ os.chdir('../../')
+ try:
+ shutil.move(os.path.join(build_dir,pdf_name),
+ os.path.join(dist_dir,pdf_name))
+ except IOError:
+ return False
def build_nup_pdf(guide):
'''Builds the nup-ed PDF for the guide'''