src/server/server.py
def on_add_profile():
    '''Adds new profile (frequency set) in the database.'''
    profile = getCurrentProfile()
    new_freqs = {}
    new_freqs["f"] = default_frequencies()

    new_profile = Database.Profiles(name=__('New Profile'),
                           description = __('New Profile'),
                           frequencies = json.dumps(new_freqs),
                           enter_ats = profile.enter_ats,
                           exit_ats = profile.exit_ats,
                           f_ratio = 100)
    DB.session.add(new_profile)
    DB.session.flush()
    DB.session.refresh(new_profile)
    new_profile.name = __('Profile %s') % new_profile.id
    DB.session.commit()

    Events.trigger(Evt.PROFILE_ADD, {
        'profile_id': new_profile.id,
        })

    on_set_profile(data={ 'profile': new_profile.id })
Adds new profile (frequency set) in the database.
Adds new profile (frequency set) in the database.
Adds new profile ( frequency set ) in the database .
def on_add_profile():
    profile = getCurrentProfile()
    new_freqs = {}
    new_freqs["f"] = default_frequencies()
    new_profile = Database.Profiles(name=__('New Profile'),
                           description = __('New Profile'),
                           frequencies = json.dumps(new_freqs),
                           enter_ats = profile.enter_ats,
                           exit_ats = profile.exit_ats,
                           f_ratio = 100)
    DB.session.add(new_profile)
    DB.session.flush()
    DB.session.refresh(new_profile)
    new_profile.name = __('Profile %s') % new_profile.id
    DB.session.commit()
    Events.trigger(Evt.PROFILE_ADD, {
        'profile_id': new_profile.id,
        })
    on_set_profile(data={ 'profile': new_profile.id })
def on_add_profile ( ) : profile = getCurrentProfile ( ) new_freqs = { } new_freqs [ "f" ] = default_frequencies ( ) new_profile = Database . Profiles ( name = __ ( 'New Profile' ) , description = __ ( 'New Profile' ) , frequencies = json . dumps ( new_freqs ) , enter_ats = profile . enter_ats , exit_ats = profile . exit_ats , f_ratio = 100 ) DB . session . add ( new_profile ) DB . session . flush ( ) DB . session . refresh ( new_profile ) new_profile . name = __ ( 'Profile %s' ) % new_profile . id DB . session . commit ( ) Events . trigger ( Evt . PROFILE_ADD , { 'profile_id' : new_profile . id , } ) on_set_profile ( data = { 'profile' : new_profile . id } )
Adds new profile (frequency set) in the database.
Adds new profile ( frequency set ) in the database .
'''Adds new profile (frequency set) in the database.'''