forked from jpatsenker/cra
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_cra_interface.py
More file actions
31 lines (27 loc) · 844 Bytes
/
run_cra_interface.py
File metadata and controls
31 lines (27 loc) · 844 Bytes
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
print "running..."
import sys
import os
import aux.jobs
from datetime import datetime
"""
#Interface for running run_cra from php
"""
"""
Toolbox for working with LOGS
"""
CONTACT_EMAIL = "<contact-email>"
def add_line_to_log(log_file, line):
with open(log_file, "a") as lfil:
lfil.write(str(line) + "\n")
if __name__ == '__main__':
sys.stdout.write('%s\n' % os.getcwd())
sys.stdout.flush()
sys.stderr.flush()
tag=datetime.today().strftime("%Y%m%d-%H%M%S-%f")
opfile=os.path.join('log', "interface.%s.out" % tag)
erfile=os.path.join('log', "interface.%s.err" % tag)
command_string = "python run_cra.py %s" % ' '.join(sys.argv[1:])
sys.stdout.write(command_string + "\n\n")
job = aux.jobs.Job(command_string)
job.run(wait=False, output=opfile, error=erfile)
sys.stdout.write("done\n")