Exemple #1
0
def register_web_ui(mgr):
    global manager, assets
    manager = mgr

    assets_cache = os.path.join(manager.config_base, '.webassets-cache')

    if not os.path.isdir(assets_cache):
        os.mkdir(assets_cache)

    assets = Environment(webui_app)
    assets.directory = assets_cache

    for p in _get_plugin_paths():
        assets.append_path(p, url="%s/plugin" % webui_app.url_path)

    assets.cache = assets_cache
    assets.url = '%s/cache' % webui_app.url_path
    if 'debug' in manager.args:
        assets.debug = True

    load_assets()
    load_ui_plugins()

    register_app(webui_app.url_path, webui_app)
    register_home('%s/' % webui_app.url_path)
Exemple #2
0
def register_web_ui(mgr):
    global manager, app_base, debug
    manager = mgr

    if 'debug' in manager.args:
        debug = True

    if debug:
        app_base = os.path.join(ui_base, '.tmp', 'serve')
        if not os.path.exists(app_base):
            log.warning('Unable to start web ui in debug mode. To enable debug mode please run the debug build, '
                     'see http://flexget.com/wiki/Web-UI for instructions')
            log.warning('Attempting to serve web ui from complied directory')
            app_base = None

    if not app_base:
        app_base = ui_dist
        if not os.path.exists(app_base):
            log.fatal('Failed to start web ui,'
                      ' this can happen if you are running from GitHub version and forgot to run the web ui build, '
                      'see http://flexget.com/wiki/Web-UI for instructions')

            app_base = None

    register_app(webui_app.url_path, webui_app)
    register_home('%s/' % webui_app.url_path)
Exemple #3
0
def register_web_ui(mgr):
    global manager, assets
    manager = mgr

    assets_cache = os.path.join(manager.config_base, '.webassets-cache')

    if not os.path.isdir(assets_cache):
        os.mkdir(assets_cache)

    assets = Environment(webui_app)
    assets.directory = assets_cache

    for p in _get_plugin_paths():
        assets.append_path(p, url="%s/plugin" % webui_app.url_path)

    assets.cache = assets_cache
    assets.url = '%s/cache' % webui_app.url_path
    if 'debug' in manager.args:
        assets.debug = True

    load_assets()
    load_ui_plugins()

    register_app(webui_app.url_path, webui_app)
    register_home('%s/' % webui_app.url_path)
Exemple #4
0
def register_web_ui(mgr):
    global manager, app_base, debug
    manager = mgr

    if 'debug' in manager.args:
        debug = True

    if debug:
        app_base = os.path.join(ui_base, '.tmp', 'serve')
        if not os.path.exists(app_base):
            log.warning(
                'Unable to start web ui in debug mode. To enable debug mode please run the debug build, '
                'see http://flexget.com/wiki/Web-UI for instructions')
            log.warning('Attempting to serve web ui from complied directory')
            app_base = None

    if not app_base:
        app_base = ui_dist
        if not os.path.exists(app_base):
            log.fatal(
                'Failed to start web ui,'
                ' this can happen if you are running from GitHub version and forgot to run the web ui build, '
                'see http://flexget.com/wiki/Web-UI for instructions')
            app_base = None

    register_app(webui_app.url_path, webui_app)
    register_home('%s/' % webui_app.url_path)