src/server/server.py
def on_discard_laps(**kwargs):
    '''Clear the current laps without saving.'''
    CLUSTER.emit('discard_laps')
    clear_laps()
    RACE.race_status = RaceStatus.READY # Flag status as ready to start next race
    INTERFACE.set_race_status(RaceStatus.READY)
    emit_current_laps() # Race page, blank laps to the web client
    emit_current_leaderboard() # Race page, blank leaderboard to the web client
    emit_race_status() # Race page, to set race button states
    race_format = getCurrentRaceFormat()
    if race_format.team_racing_mode:
        check_emit_team_racing_status()  # Show team-racing status info
    else:
        emit_team_racing_status('')  # clear any displayed "Winner is" text

    if 'saved' in kwargs and kwargs['saved'] == True:
        # discarding follows a save action
        pass
    else:
        # discarding does not follow a save action
        Events.trigger(Evt.LAPS_DISCARD)

    Events.trigger(Evt.LAPS_CLEAR)
Clear the current laps without saving.
Clear the current laps without saving.
Clear the current laps without saving .
def on_discard_laps(**kwargs):
    CLUSTER.emit('discard_laps')
    clear_laps()
    RACE.race_status = RaceStatus.READY 
    INTERFACE.set_race_status(RaceStatus.READY)
    emit_current_laps() 
    emit_current_leaderboard() 
    emit_race_status() 
    race_format = getCurrentRaceFormat()
    if race_format.team_racing_mode:
        check_emit_team_racing_status()  
    else:
        emit_team_racing_status('')  
    if 'saved' in kwargs and kwargs['saved'] == True:
        pass
    else:
        Events.trigger(Evt.LAPS_DISCARD)
    Events.trigger(Evt.LAPS_CLEAR)
def on_discard_laps ( ** kwargs ) : CLUSTER . emit ( 'discard_laps' ) clear_laps ( ) RACE . race_status = RaceStatus . READY INTERFACE . set_race_status ( RaceStatus . READY ) emit_current_laps ( ) emit_current_leaderboard ( ) emit_race_status ( ) race_format = getCurrentRaceFormat ( ) if race_format . team_racing_mode : check_emit_team_racing_status ( ) else : emit_team_racing_status ( '' ) if 'saved' in kwargs and kwargs [ 'saved' ] == True : pass else : Events . trigger ( Evt . LAPS_DISCARD ) Events . trigger ( Evt . LAPS_CLEAR )
Clear the current laps without saving.
Clear the current laps without saving .
'''Clear the current laps without saving.''' # Flag status as ready to start next race # Race page, blank laps to the web client # Race page, blank leaderboard to the web client # Race page, to set race button states # Show team-racing status info # clear any displayed "Winner is" text # discarding follows a save action # discarding does not follow a save action