Exemple #1
0
def startup():
    db.initialize()
    common.log_to_console()
    common.log_to_file()
    monitor.autostart(int(time.time()) + 5)
    debug(common.setting('api_debug').boolvalue)
    run(app=api.app,
        port=common.setting('api_port').intvalue,
        host=common.setting('api_host').value,
        server=common.setting('api_app_server').value,
        reloader=common.setting('api_debug').boolvalue,
    )
Exemple #2
0
 def do_run(self, s):
     '''
     Runs the Dofler Service
     '''
     db.initialize()
     common.log_to_console()
     common.log_to_file()
     monitor.autostart(int(time.time()) + 5)
     debug(common.setting('api_debug').boolvalue)
     run(app=api.app,
         port=common.setting('api_port').intvalue,
         host=common.setting('api_host').value,
         server=common.setting('api_app_server').value,
         reloader=common.setting('api_debug').boolvalue,
     )
Exemple #3
0
 def do_run(self, s):
     '''
     Runs the Dofler Service
     '''
     db.initialize()
     common.log_to_console()
     common.log_to_file()
     monitor.autostart(int(time.time()) + 5)
     debug(common.setting('api_debug').boolvalue)
     run(
         app=api.app,
         port=common.setting('api_port').intvalue,
         host=common.setting('api_host').value,
         server=common.setting('api_app_server').value,
         reloader=common.setting('api_debug').boolvalue,
     )
Exemple #4
0
def update_settings(settings):
    '''
    Settings Updater 
    '''
    s = SettingSession()
    for item in settings:
        if item == 'database':
            config.update(settings[item])
        else:
            settingobj = setting(item)
            if item == 'server_password':
                if settings[item] != '1234567890':
                    settingobj.value = settings[item]
            else:
                settingobj.value = settings[item]
            s.merge(settingobj)
    s.commit()
    s.close()
    common.log_to_console()
    common.log_to_file()
    monitor.autostart()
Exemple #5
0
def update_settings(settings):
    '''
    Settings Updater 
    '''
    s = SettingSession()
    for item in settings:
        if item == 'database':
            config.update(settings[item])
        else:
            settingobj = setting(item)
            if item == 'server_password':
                if settings[item] != '1234567890':
                    settingobj.value = settings[item]
            else:
                settingobj.value = settings[item]
            s.merge(settingobj)
    s.commit()
    s.close()
    common.log_to_console()
    common.log_to_file()
    monitor.autostart()
Exemple #6
0
def settings_post(db):
    '''
    Settings Update Handler. 
    '''
    s = SettingSession()
    if auth(request):
        for item in request.forms:
            settingobj = setting(item)
            if item == 'server_password':
                if request.forms['server_password'] != '1234567890':
                    settingobj.value = request.forms[item]
            else:
                settingobj.value = request.forms[item]
            s.merge(settingobj)
        s.commit()
        s.close()
        common.log_to_console()
        common.log_to_file()
        monitor.autostart()
        return get_settings_page(auth(request), note='Settings Updated')
    else:
        return get_settings_page(auth(request),
            error='Must be Authenticated to Change Settings')