# HG changeset patch # User george-weingart # Date 1399422026 14400 # Node ID 6e94c5a60c800ed6397d5a9c57328633e6652e0c # Parent 1dcb00d567f75f649414f7053dd8a6061ce3b259 Removed obsolete prints; Set the process using subprocess and using tempfile to alllocate the temporary file diff -r 1dcb00d567f7 -r 6e94c5a60c80 micropita_prepare.py --- 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)