otime/test_files/sc3_23/sc3_test.py

33 lines
1.4 KiB
Python
Raw Permalink Normal View History

2023-11-02 21:57:28 +00:00
import sys
sys.path.insert(0, '../../otime')
import otime
2023-11-06 14:15:04 +00:00
import pdf
2023-11-07 14:57:44 +00:00
import iof_xml
import file_io
2023-11-02 21:57:28 +00:00
def ttime_testing():
2023-11-02 21:57:28 +00:00
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')
2023-11-06 14:15:04 +00:00
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'))
2023-11-02 21:57:28 +00:00
if __name__ == '__main__':
xml_testing()