Пример #1
0
def init():
    xconfig.IS_TEST = True
    xconfig.port = "1234"
    xconfig.DEV_MODE = True
    var_env = dict()
    xutils.remove_file("./testdata/data.db", hard = True)
    xconfig.init("./testdata")
    xtables.init()
    app = web.application(list(), var_env, autoreload=False)
    last_mapping = (r"/tools/(.*)", "handlers.tools.tools.handler")
    mgr = xmanager.init(app, var_env, last_mapping=last_mapping)
    mgr.reload()
    return app
Пример #2
0
def init():
    global APP
    if APP is not None:
        return APP
    xconfig.IS_TEST = True
    xconfig.port = "1234"
    xconfig.DEV_MODE = True
    var_env = dict()
    xutils.remove_file("./testdata/data.db", hard=True)
    xconfig.init("./testdata")
    xtables.init()
    dbutil.init()
    APP = web.application(list(), var_env, autoreload=False)
    last_mapping = (r"/tools/(.*)", "handlers.tools.tools.handler")
    mgr = xmanager.init(APP, var_env, last_mapping=last_mapping)
    mgr.reload()
    # 加载template
    xtemplate.reload()
    return APP