Exemplo n.º 1
0
def run(script_path):
    """Run a script in a separate thread and start a server for the app.

    This starts a blocking ioloop.

    Parameters
    ----------
    script_path : str

    """
    _fix_sys_path(script_path)
    _fix_matplotlib_crash()

    # Install a signal handler that will shut down the ioloop
    # and close all our threads
    _set_up_signal_handler()

    ioloop = tornado.ioloop.IOLoop.current()

    # Create and start the server.
    server = Server(ioloop, script_path, sys.argv)
    server.add_preheated_report_session()
    server.start(_on_server_start)

    # Start the ioloop. This function will not return until the
    # server is shut down.
    ioloop.start()
Exemplo n.º 2
0
def run(script_path, command_line, args):
    """Run a script in a separate thread and start a server for the app.

    This starts a blocking ioloop.

    Parameters
    ----------
    script_path : str
    command_line : str
    args : [str]

    """
    _fix_sys_path(script_path)
    _fix_matplotlib_crash()
    _fix_tornado_crash()
    _fix_sys_argv(script_path, args)

    # Install a signal handler that will shut down the ioloop
    # and close all our threads
    _set_up_signal_handler()

    ioloop = tornado.ioloop.IOLoop.current()

    # Create and start the server.
    server = Server(ioloop, script_path, command_line)
    server.start(_on_server_start)

    # (Must com after start(), because this starts a new thread and start() may
    # call sys.exit() which doesn't kill other threads.
    server.add_preheated_report_session()

    # Start the ioloop. This function will not return until the
    # server is shut down.
    ioloop.start()
Exemplo n.º 3
0
def run(script_path, command_line, args):
    bootstrap._fix_sys_path(script_path)
    bootstrap._fix_matplotlib_crash()
    bootstrap._fix_tornado_crash()
    bootstrap._fix_sys_argv(script_path, args)
    bootstrap._fix_pydeck_mapbox_api_warning()

    bootstrap._set_up_signal_handler()

    ioloop = tornado.ioloop.IOLoop.current()

    server = Server(ioloop, script_path, command_line)

    server.start(_on_server_start)
    server.add_preheated_report_session()
    ioloop.start()