# HG changeset patch # User pieter.lukasse@wur.nl # Date 1422032220 -3600 # Node ID 3abd271b462664a294e78dbe3810eebe0ab5cdae # Parent a394029414c6978d9dc13eea8c81502f99502070 killing nist at exception diff -r a394029414c6 -r 3abd271b4626 nist_wrapper.py --- a/nist_wrapper.py Fri Jan 23 17:42:19 2015 +0100 +++ b/nist_wrapper.py Fri Jan 23 17:57:00 2015 +0100 @@ -142,6 +142,7 @@ if timeSleeping > (startUpTime + job_size*2): # abort with timeout: utils.log_message(log_file, "No results after " + str(timeSleeping) + " seconds...") + _kill_NIST(pro, is_wine) # uggly workaround: utils.kill_process_by_name("nistms.exe") utils.kill_process_by_name("nistms$.exe") @@ -151,19 +152,29 @@ # kill process: #p.terminate() - not needed, nistm$ will terminate...nistms.exe is the one that #stays open...and orphan..killing it: + _kill_NIST(pro, is_wine) + + # copy SRCRESLT.TXT to output_file + result_file = new_nist_home+"/MSSEARCH/SRCRESLT.TXT" + utils.copy_file(result_file, output_file) + + +def _kill_NIST(process_group, is_wine): + ''' + nistm$ will terminate...nistms.exe is the one that + stays open...and orphan. This method kills it. + ''' if is_wine: # pid = utils.get_process_pid("nistms.exe") # os.kill(pid, 9) - os.killpg(pro.pid, 9) + os.killpg(process_group.pid, 9) else: # windows case: proc_name = "nistms.exe" os.system("taskkill /f /im " + proc_name) - # copy SRCRESLT.TXT to output_file - result_file = new_nist_home+"/MSSEARCH/SRCRESLT.TXT" - utils.copy_file(result_file, output_file) + def _create_html_report(output_html_report, output_html_report_files_path, hits_dict, spectra_dict):