src/server/server.py
def on_add_pilot():
    '''Adds the next available pilot id number in the database.'''
    new_pilot = Database.Pilot(name='New Pilot',
                           callsign='New Callsign',
                           team=DEF_TEAM_NAME,
                           phonetic = '')
    DB.session.add(new_pilot)
    DB.session.flush()
    DB.session.refresh(new_pilot)
    new_pilot.name = __('~Pilot %d Name') % (new_pilot.id)
    new_pilot.callsign = __('~Callsign %d') % (new_pilot.id)
    new_pilot.team = DEF_TEAM_NAME
    new_pilot.phonetic = ''
    DB.session.commit()

    Events.trigger(Evt.PILOT_ADD, {
        'pilot_id': new_pilot.id,
        })

    logger.info('Pilot added: Pilot {0}'.format(new_pilot.id))
    emit_pilot_data()
Adds the next available pilot id number in the database.
Adds the next available pilot id number in the database.
Adds the next available pilot id number in the database .
def on_add_pilot():
    new_pilot = Database.Pilot(name='New Pilot',
                           callsign='New Callsign',
                           team=DEF_TEAM_NAME,
                           phonetic = '')
    DB.session.add(new_pilot)
    DB.session.flush()
    DB.session.refresh(new_pilot)
    new_pilot.name = __('~Pilot %d Name') % (new_pilot.id)
    new_pilot.callsign = __('~Callsign %d') % (new_pilot.id)
    new_pilot.team = DEF_TEAM_NAME
    new_pilot.phonetic = ''
    DB.session.commit()
    Events.trigger(Evt.PILOT_ADD, {
        'pilot_id': new_pilot.id,
        })
    logger.info('Pilot added: Pilot {0}'.format(new_pilot.id))
    emit_pilot_data()
def on_add_pilot ( ) : new_pilot = Database . Pilot ( name = 'New Pilot' , callsign = 'New Callsign' , team = DEF_TEAM_NAME , phonetic = '' ) DB . session . add ( new_pilot ) DB . session . flush ( ) DB . session . refresh ( new_pilot ) new_pilot . name = __ ( '~Pilot %d Name' ) % ( new_pilot . id ) new_pilot . callsign = __ ( '~Callsign %d' ) % ( new_pilot . id ) new_pilot . team = DEF_TEAM_NAME new_pilot . phonetic = '' DB . session . commit ( ) Events . trigger ( Evt . PILOT_ADD , { 'pilot_id' : new_pilot . id , } ) logger . info ( 'Pilot added: Pilot {0}' . format ( new_pilot . id ) ) emit_pilot_data ( )
Adds the next available pilot id number in the database.
Adds the next available pilot id number in the database .
'''Adds the next available pilot id number in the database.'''