forked from Trygve/otime
Oppdaterte GUIen til å bruke event klassen
This commit is contained in:
parent
13949303a5
commit
8888a52ff2
@ -138,23 +138,24 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||
if response == Gtk.ResponseType.ACCEPT:
|
||||
file = dialog.get_file()
|
||||
filename = file.get_path()
|
||||
courses = otime.courses_from_ttime_conf(ttime_cnf_file)
|
||||
o_classes = otime.classes_from_ttime_conf(ttime_cnf_file, courses)
|
||||
runners = otime.ttime_db_to_class(ttime_db_file, o_classes)
|
||||
otime.ttime_mtr_to_class(mtr_file, runners)
|
||||
otime.gen_xml_result(runners, o_classes).write(filename)
|
||||
event = otime.event(0, 'NoName')
|
||||
event.import_ttime_cnf(ttime_cnf_file)
|
||||
event.import_ttime_db(ttime_db_file)
|
||||
event.import_mtr_file(mtr_file)
|
||||
event.match_runners_cards()
|
||||
event.get_xml_res().write(filename)
|
||||
|
||||
runners_ok = []
|
||||
for n in runners:
|
||||
runners_ok = 0
|
||||
for n in event.runners:
|
||||
if n.status() == 'OK':
|
||||
runners_ok.append(n)
|
||||
runners_ok += 1
|
||||
|
||||
runners_dsq = []
|
||||
for n in runners:
|
||||
runners_dsq = 0
|
||||
for n in event.runners:
|
||||
if n.status() == 'Disqualified':
|
||||
runners_dsq.append(n)
|
||||
runners_dsq += 1
|
||||
|
||||
self.text_buffer.set_text(f'Antall påmeldte: {len(runners)} \nAntall godkjente: {len(runners_ok)} \nAntall dsq: {len(runners_dsq)}')
|
||||
self.text_buffer.set_text(f'Antall påmeldte: {len(event.runners)} \nAntall godkjente: {runners_ok} \nAntall dsq: {runners_dsq}')
|
||||
|
||||
self.save_toast = Adw.Toast.new('Fil lagra i: '+filename)
|
||||
self.save_toast.set_timeout(8)
|
||||
|
Loading…
Reference in New Issue
Block a user