msg = 'There is no ' + collection + '.configuration.ini' #################################### if not valid_conf: print(msg) else: #################################### # instancing reports log_filename = config.parameters['LOG_FILENAME'] err_filename = config.parameters['ERROR_FILENAME'] summary_filename = config.parameters['SUMMARY_REPORT'] debug_depth = config.parameters['DEBUG_DEPTH'] display_on_screen = config.parameters['DISPLAY_MESSAGES_ON_SCREEN'] report_path = config.parameter('REPORT_PATH') + '/' + return_path_based_on_date() if not os.path.exists(report_path): os.makedirs(report_path) files = [ log_filename, err_filename, summary_filename] log_filename, err_filename, summary_filename = [ report_path + '/xmlproc_' + f for f in files ] report = Report(log_filename, err_filename, summary_filename, int(debug_depth), (display_on_screen == 'yes')) # work path work_path = config.parameter('WORK_PATH') processing_serial_path = config.parameters['COL_PROC_SERIAL_PATH'] web_pdf_path = config.parameters['PDF_PATH'] web_img_path = config.parameters['IMG_PATH']
report_path = config.parameters['REPORT_PATH'] + '/' + return_path_based_on_date() if not os.path.exists(report_path): os.makedirs(report_path) files = [ log_filename, err_filename, summary_filename] log_filename, err_filename, summary_filename = [ report_path + '/ftp_' + f for f in files ] report_ftp = Report(log_filename, err_filename, summary_filename, int(debug_depth), (display_on_screen == 'yes')) work_path = config.parameters['WORK_PATH'] download_path = config.parameters['DOWNLOAD_PATH'] server = config.parameter('FTP_SERVER') user = config.parameter('FTP_USER') pasw = config.parameter('FTP_PSWD') folder = config.parameter('FTP_DIR') fservice = FTPService(report_ftp, server, user, pasw) tracker = Tracker(config.parameter('DOWNLOAD_TRACKER_PATH'), config.parameter('DOWNLOAD_TRACKER_NAME')) email_service = EmailService('', config.parameter('SENDER_EMAIL'), 'localhost', config.parameter('IS_AVAILABLE_EMAIL_SERVICE') == 'yes') report_sender_config = ReportSenderConfiguration(config.parameter('BCC_EMAIL'), config.parameter('FLAG_SEND_EMAIL_TO_XML_PROVIDER') == 'yes', config.parameter('ALERT_FORWARD'), config.parameter('FLAG_ATTACH_REPORTS')) report_sender = ReportSender(email_service, report_sender_config) template = EmailMessageTemplate(config.parameter('EMAIL_SUBJECT_PREFIX_DOWNLOAD'), config.parameter('EMAIL_TEXT_DOWNLOAD'))
msg = 'There is no ' + collection + '.configuration.ini' #################################### if not valid_conf: print(msg) else: #################################### # instancing reports log_filename = config.parameters['LOG_FILENAME'] err_filename = config.parameters['ERROR_FILENAME'] summary_filename = config.parameters['SUMMARY_REPORT'] debug_depth = config.parameters['DEBUG_DEPTH'] display_on_screen = config.parameters['DISPLAY_MESSAGES_ON_SCREEN'] report_path = config.parameter('REPORT_PATH') + '/' + return_path_based_on_date() if not os.path.exists(report_path): os.makedirs(report_path) files = [ log_filename, err_filename, summary_filename] log_filename, err_filename, summary_filename = [ report_path + '/xmlproc_' + f for f in files ] report = Report(log_filename, err_filename, summary_filename, int(debug_depth), (display_on_screen == 'yes')) # work path work_path = config.parameter('WORK_PATH') batch_work_path = work_path + '/' + datetime.now().isoformat()[11:16].replace(':','') if not os.path.exists(batch_work_path): os.makedirs(batch_work_path) processing_serial_path = config.parameters['COL_PROC_SERIAL_PATH']
files = [log_filename, err_filename, summary_filename] log_filename, err_filename, summary_filename = [report_path + '/gerapadrao-' + f for f in files] report = Report(log_filename, err_filename, summary_filename, int(debug_depth), (display_on_screen == 'yes')) proc_title_db = config.parameters['PROC_DB_TITLE_FILENAME'] proc_issue_db = config.parameters['PROC_DB_ISSUE_FILENAME'] if not os.path.exists(os.path.dirname(proc_title_db)): os.makedirs(os.path.dirname(proc_title_db)) if not os.path.exists(os.path.dirname(proc_issue_db)): os.makedirs(os.path.dirname(proc_issue_db)) cisis = CISIS(config.parameters['CISIS_PATH']) email_service = EmailService('', config.parameter('SENDER_EMAIL'), 'localhost', config.parameter('IS_AVAILABLE_EMAIL_SERVICE') == 'yes') report_sender_config = ReportSenderConfiguration(config.parameter('BCC_EMAIL'), config.parameter('FLAG_SEND_EMAIL_TO_XML_PROVIDER') == 'yes', config.parameter('ALERT_FORWARD'), config.parameter('FLAG_ATTACH_REPORTS')) report_sender = ReportSender(email_service, report_sender_config) template = EmailMessageTemplate(config.parameter('EMAIL_SUBJECT_PREFIX_GERAPADRAO'), config.parameter('EMAIL_TEXT_GERAPADRAO')) status = get_status(config.parameter('CTRL_FILE')) doit = (status == 'finished') if doit: set_status(config.parameter('CTRL_FILE'), 'running') report.write('Start', True, False, False) cisis.create('null count=0', proc_title_db) cisis.create('null count=0', proc_issue_db) proc_scilista = config.parameters['PROC_SERIAL_PATH'] + '/scilista.lst' proc_scilista_del = config.parameters['PROC_SERIAL_PATH'] + '/scilista_del.lst'
log_filename, err_filename, summary_filename = [ report_path + '/' + f for f in files ] report = Report(log_filename, err_filename, summary_filename, int(debug_depth), (display_on_screen == 'yes')) proc_title_db = config.parameters['PROC_DB_TITLE_FILENAME'] proc_issue_db = config.parameters['PROC_DB_ISSUE_FILENAME'] if not os.path.exists(os.path.dirname(proc_title_db)): os.makedirs(os.path.dirname(proc_title_db )) if not os.path.exists(os.path.dirname(proc_issue_db)): os.makedirs(os.path.dirname(proc_issue_db )) cisis = CISIS(config.parameters['CISIS_PATH']) tracker = Tracker(config.parameter('GERAPADRAO_TRACKER_PATH'), config.parameter('GERAPADRAO_TRACKER_NAME')) #message_type = MessageType(config.parameter('EMAIL_SUBJECT_PREFIX_GERAPADRAO'), config.parameter('EMAIL_TEXT_GERAPADRAO'), config.parameter('FLAG_SEND_EMAIL_TO_XML_PROVIDER'), config.parameter('ALERT_FORWARD'), config.parameter('FLAG_ATTACH_REPORTS')) #report_sender = ReportSender(report, config.parameter('IS_AVAILABLE_EMAIL_SERVICE'), email_service, config.parameter('BCC_EMAIL').split(','), message_type) email_service = EmailService('', config.parameter('SENDER_EMAIL'), 'localhost', config.parameter('IS_AVAILABLE_EMAIL_SERVICE') == 'yes') report_sender_config = ReportSenderConfiguration(config.parameter('BCC_EMAIL'), config.parameter('FLAG_SEND_EMAIL_TO_XML_PROVIDER') == 'yes', config.parameter('ALERT_FORWARD'), config.parameter('FLAG_ATTACH_REPORTS')) report_sender = ReportSender(email_service, report_sender_config) template = EmailMessageTemplate(config.parameter('EMAIL_SUBJECT_PREFIX_GERAPADRAO'), config.parameter('EMAIL_TEXT_GERAPADRAO')) tracker.register('GeraPadrao', 'preparation') ## - report.write('Reset ' + proc_title_db, True, False, True)