java_xml_transformer = JavaXMLTransformer(config.parameter('JAVA_PATH'), config.parameter('SAXON_PATH'), config.parameter('VALIDATOR_PATH')) pmc_xsl_and_output = Configuration( 'pmc.article.xsl.ini') xsl_and_output_list = {} for k, item in pmc_xsl_and_output.parameters.items(): pair = item.split(',') xsl_and_output_list[k] = {'xsl': pair[0], 'output': pair[1]} fulltext_generator = FullTextGenerator(java_xml_transformer, xsl_and_output_list) if os.path.exists(config.parameter('COL_SCILISTA')): os.unlink(config.parameter('COL_SCILISTA')) reception = Reception(work_path, report_sender, package_eval_msg_template, report_path, tracker) reception.open_packages(document_analyst, document_archiver, ImageConverter(), fulltext_generator) if len(os.listdir(work_path))>0: print('\n'.join(os.listdir(work_path))) report_sender.send_to_adm(adm_msg_template, '\n'.join(os.listdir(work_path))) print('-' * 80) print('Check report files: ') print('Errors report: ' + err_filename) print('Summarized report: ' + summary_filename) print('Detailed report: ' + log_filename) print('Reports for each package of XML files in ' + work_path)
open('./transf_files.sh', 'w').write(update_files_content(all_the_scilista_items, config.parameters['TRANSF_SOURCE'], config.parameters['USERATHOST'], config.parameters['TRANSF_DEST'])) report.write('chmod 777 ./transf_files.sh', True, False, False) os.system('chmod 777 ./transf_files.sh') report.write('./transf_files.sh', True, False, False) os.system('./transf_files.sh') report.write('tranferiu', True, False, False) except Exception as e: report.write('deu erro', True, False, False) report.write(str(e), True, False, False) report.write('set status as finished', True, False, False) #set_status(config.parameters['CTRL_FILE'], 'finished') report.write('status:', True, False, False) report.write(get_status(config.parameters['CTRL_FILE']), True, False, False) report.write('envia email', True, False, False) print(report_sender.send_to_adm(template, '\n'.join(all_the_scilista_items))) report.write('fim', True, False, False) #for scilista_file in scilista_files: # if os.path.isfile(scilista_file): # os.unlink(scilista_file) else: report.write('set status as finished. No item in scilista.', True, False, False) set_status(config.parameters['CTRL_FILE'], 'finished') report.write('status:', True, False, False) report.write(get_status(config.parameters['CTRL_FILE']), True, False, False) report.write('fim', True, False, False) else: report.write('start', True, False, False) report.write('end', True, False, False)