import sys sys.path.insert(0, '../../otime') import otime import pdf import iof_xml import file_io def ttime_testing(): event = otime.Event(0, 'TEEEST', start_time=None, end_time=None,organiser='Tygbe') event.read_ttime_cnf('tt.cnf') event.read_ttime_db('db.csv') event.read_mtr_file('mtr.csv') pdf.create_split_result_list(event, 'output/result.pdf') iof_xml.create_result_file(event, '/home/trygve/Prosjekter/simple-liveresults/resultater/Resultater.xml') print(event.get_runner_status('1400')) results = event.get_result() print([pdf.format_m_s(i) for i in event.get_runner_splits('17')]) print([pdf.format_m_s(i) for i in event.get_card_dump(event.get_runner('17').card_id).splits]) file_io.write_config(event, 'output/config.yaml') file_io.write_card_dumps(event, 'output/mtr.yaml') file_io.write_runners_csv(event, 'output/runners.csv') print(file_io.event_from_yaml_and_csv('output/config.yaml', 'output/mtr.yaml', 'output/runners.csv')) def xml_testing(): event = iof_xml.event_from_xml_entries('entries.xml') event.courses = iof_xml.courses_from_xml('course.xml') file_io.write_config(event, 'output/config.yaml') file_io.write_card_dumps(event, 'output/mtr.yaml') file_io.write_runners_csv(event, 'output/runners.csv') print(file_io.event_from_yaml_and_csv('output/config.yaml', 'output/mtr.yaml', 'output/runners.csv')) if __name__ == '__main__': xml_testing()