示例#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,
    )
示例#2
0
文件: cli.py 项目: blha303/DoFler
 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,
     )
示例#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,
     )
示例#4
0
文件: ui.py 项目: TMcKinley/DoFler
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()
示例#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()
示例#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')