def _get_result(card_data): result = memory.race().new_result(memory.ResultSportiduino) result.card_number = int(card_data['card_number']) for i in range(len(card_data['punches'])): t = card_data['punches'][i][1] if t: split = memory.Split() split.code = str(card_data['punches'][i][0]) split.time = time_to_otime(t) split.days = memory.race().get_days(t) result.splits.append(split) if card_data['start']: result.start_time = time_to_otime(card_data['start']) if card_data['finish']: result.finish_time = time_to_otime(card_data['finish']) return result
def _get_result(card_data): result = memory.race().new_result(memory.ResultSFR) result.card_number = card_data['bib'] # SFR has no card id, only bib for i in range(len(card_data['punches'])): t = card_data['punches'][i][1] if t: split = memory.Split() split.code = str(card_data['punches'][i][0]) split.time = time_to_otime(t) split.days = memory.race().get_days(t) if split.code != '0' and split.code != '': result.splits.append(split) if card_data['start']: result.start_time = time_to_otime(card_data['start']) if card_data['finish']: result.finish_time = time_to_otime(card_data['finish']) return result