Mercurial > repos > george-weingart > micropita
changeset 12:6e94c5a60c80
Removed obsolete prints; Set the process using subprocess and using tempfile to alllocate the temporary file
author | george-weingart |
---|---|
date | Tue, 06 May 2014 20:20:26 -0400 |
parents | 1dcb00d567f7 |
children | 627e25eb606d |
files | micropita_prepare.py |
diffstat | 1 files changed, 16 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/micropita_prepare.py Tue May 06 18:21:51 2014 -0400 +++ b/micropita_prepare.py Tue May 06 20:20:26 2014 -0400 @@ -46,8 +46,9 @@ import tempfile ################################################################################## -# Modification # -# Using subprocess # +# Modification by George Weingart 5/6/2014 # +# Using subprocess to invoke the calls to Micropita # +# and allocating the temporary file using trmpfile # ################################################################################## @@ -78,9 +79,6 @@ parser.add_argument('--label_value', action="store",dest='label_value') except: pass - - - return parser @@ -151,12 +149,14 @@ results.outputname #print os_command os.system(os_command) + argsx = shlex.split(os_command) #Split the command + try: + subprocess.check_call(argsx , shell=False) + except: + print "The call to micropita failed=============" + sys.exit(0) - -######"/tools/micropita/" + \ 1234 -print "Before invoking the call 1234" -print root_dir if results.MParameter == "representative"\ or results.MParameter == "diverse"\ @@ -170,9 +170,7 @@ stratify_string + " " + \ results.inputname + " " +\ results.outputname - ##print os_command - argsx = shlex.split(os_command) - print argsx + argsx = shlex.split(os_command) #Split the command try: ###os.system(os_command) subprocess.check_call(argsx , shell=False) @@ -196,4 +194,9 @@ results.inputname + " " +\ results.outputname #print os_command - os.system(os_command) + argsx = shlex.split(os_command) #Split the command + try: + subprocess.check_call(argsx , shell=False) + except: + print "The call to micropita failed=============" + sys.exit(0)