def create_sub2_hts(sub): retval = False flag_1 = self.state > election.ETAPP_ENNE_HAALETUST flag_2 = evfiles.statusreport_file().exists() if flag_1 or flag_2: retval = True sub.create(CHOICE_AUDIT) if flag_1: sub.add_item(CHOICE_CREATE_STATUS_REPORT, serviceutil.do_create_status_report) sub.add_item(CHOICE_CREATE_STATUS_REPORT_NO_VERIFY, serviceutil.do_create_status_report_no_verify) if flag_2: sub.add_item(CHOICE_VIEW_STATUS_REPORT, serviceutil.do_view_status_report) return retval
def update_files(self, elid, usebinary=True): """ Siin hoiame up-to-date faili tabelit, mida saab sirvida/printida/exportida """ self.file_table = {} # string : path files = evfiles.EvFileTable() if Election().is_hes(): files.add_file(evfiles.application_log_file()) files.add_file(evfiles.error_log_file()) files.add_file(evfiles.integrity_log_file()) files.add_file(evfiles.voter_list_log_file()) elif Election().is_hts(): files.add_file(evfiles.log1_file(elid)) files.add_file(evfiles.log2_file(elid)) files.add_file(evfiles.log3_file(elid)) files.add_file(evfiles.revlog_file(elid)) files.add_file(evfiles.application_log_file()) files.add_file(evfiles.error_log_file()) files.add_file(evfiles.voter_list_log_file()) files.add_file(evfiles.elections_result_file(elid)) files.add_file(evfiles.electorslist_file(elid)) files.add_file(evfiles.electorslist_file_pdf(elid)) files.add_file(evfiles.revreport_file(elid)) files.add_file(evfiles.statusreport_file()) files.add_file(evfiles.ocsp_log_file()) evfiles.add_hts_files_to_table(elid, files) elif Election().is_hlr(): files.add_file(evfiles.log4_file(elid)) files.add_file(evfiles.log5_file(elid)) files.add_file(evfiles.application_log_file()) files.add_file(evfiles.error_log_file()) files.add_file(evfiles.electionresult_zip_file(elid)) files.add_file(evfiles.electionresult_file(elid)) files.add_file(evfiles.electionresultstat_file(elid)) self.file_table = files.get_existing_files(usebinary)
def do_view_status_report(): import evfiles report_file = evfiles.statusreport_file().path() cmd = "%s %s" % (PROGRAM_LESS, report_file) os.system(cmd)
def do_view_status_report(): import evfiles report_file = evfiles.statusreport_file().path() subprocess.call([PROGRAM_LESS, report_file])