#!/usr/bin/python

import subprocess
import glob

subprocess.check_call(["pdflatex", "-halt-on-error", "-file-line-error", "main.tex"])
if len(glob.glob("*.bib"))>0:
  subprocess.check_call(["bibtex", "main"])
subprocess.check_call(["pdflatex", "-halt-on-error", "-file-line-error", "main.tex"])
subprocess.check_call(["pdflatex", "-halt-on-error", "-file-line-error", "main.tex"])
subprocess.check_call(["pdflatex", "-halt-on-error", "-file-line-error", "main.tex"])

4ca8a4b1e20657503a1055125de23b7b0fd90644
<mask token>

<mask token>
subprocess.check_call(['pdflatex', '-halt-on-error', '-file-line-error',
    'main.tex'])
if len(glob.glob('*.bib')) > 0:
    subprocess.check_call(['bibtex', 'main'])
subprocess.check_call(['pdflatex', '-halt-on-error', '-file-line-error',
    'main.tex'])
subprocess.check_call(['pdflatex', '-halt-on-error', '-file-line-error',
    'main.tex'])
subprocess.check_call(['pdflatex', '-halt-on-error', '-file-line-error',
    'main.tex'])

import subprocess
import glob
subprocess.check_call(['pdflatex', '-halt-on-error', '-file-line-error',
    'main.tex'])
if len(glob.glob('*.bib')) > 0:
    subprocess.check_call(['bibtex', 'main'])
subprocess.check_call(['pdflatex', '-halt-on-error', '-file-line-error',
    'main.tex'])
subprocess.check_call(['pdflatex', '-halt-on-error', '-file-line-error',
    'main.tex'])
subprocess.check_call(['pdflatex', '-halt-on-error', '-file-line-error',
    'main.tex'])

#!/usr/bin/python

import subprocess
import glob

subprocess.check_call(["pdflatex", "-halt-on-error", "-file-line-error", "main.tex"])
if len(glob.glob("*.bib"))>0:
  subprocess.check_call(["bibtex", "main"])
subprocess.check_call(["pdflatex", "-halt-on-error", "-file-line-error", "main.tex"])
subprocess.check_call(["pdflatex", "-halt-on-error", "-file-line-error", "main.tex"])
subprocess.check_call(["pdflatex", "-halt-on-error", "-file-line-error", "main.tex"])
