示例#1
0
文件: webserver.py 项目: ssj71/mod-ui
def prepare(isModApp = False):
    check_environment()
    lv2_init()

    gState.favorites = safe_json_load(FAVORITES_JSON_FILE, list)

    if len(gState.favorites) > 0:
        uris = get_plugin_list()
        for uri in gState.favorites:
            if uri not in uris:
                gState.favorites.remove(uri)

    if False:
        print("Scanning plugins, this may take a little...")
        get_all_plugins()
        print("Done!")

    if not isModApp:
        signal(SIGUSR1, signal_recv)
        signal(SIGUSR2, signal_recv)
        set_process_name("mod-ui")

    application.listen(DEVICE_WEBSERVER_PORT, address="0.0.0.0")
    if LOG:
        from tornado.log import enable_pretty_logging
        enable_pretty_logging()

    def checkhost():
        if SESSION.host.readsock is None or SESSION.host.writesock is None:
            print("Host failed to initialize, is the backend running?")
            SESSION.host.close_jack()
            sys.exit(1)

        elif not SESSION.host.connected:
            ioinstance.call_later(0.2, checkhost)

    ioinstance = IOLoop.instance()
    ioinstance.add_callback(checkhost)
示例#2
0
文件: webserver.py 项目: EQ4/mod-ui
    def check():
        if SESSION.host.sock is None:
            print("Host failed to initialize, is ingen running?")
            sys.exit(1)

        check_environment()
示例#3
0
 def check():
     check_environment(lambda result: result)
示例#4
0
    def check():
        if SESSION.host.sock is None:
            print("Host failed to initialize, is ingen running?")
            sys.exit(1)

        check_environment()