-
Notifications
You must be signed in to change notification settings - Fork 28
/
run_paper.py
42 lines (26 loc) · 999 Bytes
/
run_paper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from subprocess import call
import platform
system = platform.system()
person = '' # use the person variable to keep paths in order with multiple machines being used
if person == '':
path = '/path/to/main_paper'
if system == 'Windows':
pass
else:
print "Cleans Output and Temporary"
for folder in ['/output', '/tmp']:
shutil.rmtree(path+folder)
os.mkdir(path+folder)
print "//-- Gets Input --//"
call(['python', path+'/code/get_input.py'])
print "//-- Runs Build --//"
call(['stata', '-b', 'do' + '\"' + path+'/code/build.do'+'\" &'])
for file in glob.glob(path+'/*.log'):
os.remove(file)
print "//-- Runs Analysis --//"
call(['stata', '-b', 'do' + '\"' + path+'/code/analysis.do'+'\" &'])
for file in glob.glob(path+'/*.log'):
os.remove(file)
print "//-- Compiles TeX --//"
call(['latexmk', path+'/products/paper/main_article.tex')
print "Congratulations, you have a shiny new paper!"