|
125 |
cmd = ['pdflatex', '-interaction=nonstopmode', '-halt-on-error', '-output-directory=%s' % os.path.dirname(latex_file), latex_file] |
125 |
cmd = ['pdflatex', '-interaction=nonstopmode', '-halt-on-error', '-output-directory=%s' % os.path.dirname(latex_file), latex_file] |
126 |
devnull = open(os.path.devnull, 'w') |
126 |
devnull = open(os.path.devnull, 'w') |
127 |
try: |
127 |
try: |
128 |
if not subprocess.call(cmd, stdout=devnull, stderr=devnull): |
128 |
env_vars = {'HOME': '/var/cache/univention-directory-reports'} |
129 |
if not subprocess.call(cmd, stdout=devnull, stderr=devnull): |
129 |
if not subprocess.call(cmd, stdout=devnull, stderr=devnull, env=env_vars): |
|
|
130 |
if not subprocess.call(cmd, stdout=devnull, stderr=devnull, env=env_vars): |
130 |
return '%s.pdf' % latex_file.rsplit('.', 1)[0] |
131 |
return '%s.pdf' % latex_file.rsplit('.', 1)[0] |
131 |
print >>sys.stderr, "error: failed to create PDF file" |
132 |
print >>sys.stderr, "error: failed to create PDF file" |
132 |
return None |
133 |
return None |