コード例 #1
0
ファイル: startup.py プロジェクト: ndim/miro
def startup():
    """Startup Miro.

    This method starts up the eventloop and schedules the rest of the startup
    to run in the event loop.

    Frontends should call this method, then wait for 1 of 2 messages

    StartupSuccess is sent once the startup is done and the backend is ready
    to go.

    StartupFailure is sent if something bad happened.

    initialize() must be called before startup().
    """
    logging.info("Starting up %s", app.config.get(prefs.LONG_APP_NAME))
    logging.info("Version:    %s", app.config.get(prefs.APP_VERSION))
    logging.info("Revision:   %s", app.config.get(prefs.APP_REVISION))
    logging.info("Builder:    %s", app.config.get(prefs.BUILD_MACHINE))
    logging.info("Build Time: %s", app.config.get(prefs.BUILD_TIME))
    logging.info("Debugmode:  %s", app.debugmode)
    eventloop.connect('thread-started', startup_for_frontend)
    logging.info("Reading HTTP Password list")
    httpauth.init()
    httpauth.restore_from_file()
    logging.info("Starting libCURL thread")
    httpclient.init_libcurl()
    httpclient.start_thread()
    logging.info("Starting event loop thread")
    eventloop.startup()
    if DEBUG_DB_MEM_USAGE:
        mem_usage_test_event.wait()
    load_extensions()
コード例 #2
0
ファイル: startup.py プロジェクト: kmshi/miro
def startup():
    """Startup Miro.

    This method starts up the eventloop and schedules the rest of the startup
    to run in the event loop.

    Frontends should call this method, then wait for 1 of 2 messages

    StartupSuccess is sent once the startup is done and the backend is ready
    to go.

    StartupFailure is sent if something bad happened.

    initialize() must be called before startup().
    """
    logging.info("Starting up %s", app.config.get(prefs.LONG_APP_NAME))
    logging.info("Version:    %s", app.config.get(prefs.APP_VERSION))
    logging.info("Revision:   %s", app.config.get(prefs.APP_REVISION))
    logging.info("Builder:    %s", app.config.get(prefs.BUILD_MACHINE))
    logging.info("Build Time: %s", app.config.get(prefs.BUILD_TIME))
    logging.info("Debugmode:  %s", app.debugmode)
    eventloop.connect('thread-started', finish_startup)
    logging.info("Reading HTTP Password list")
    httpauth.init()
    httpauth.restore_from_file()
    logging.info("Starting libCURL thread")
    httpclient.init_libcurl()
    httpclient.start_thread()
    logging.info("Starting event loop thread")
    eventloop.startup()
    if DEBUG_DB_MEM_USAGE:
        mem_usage_test_event.wait()
    load_extensions()
コード例 #3
0
ファイル: MiroDownloader.py プロジェクト: codito/miro
def finish_startup_after_config():
    """Finish startup tasks once we have config setup.

    Called from command.InitialConfigCommand.
    """

    from miro import gtcache
    gtcache.init()

    from miro import httpclient
    from miro.dl_daemon import download
    download.startup()
    httpclient.init_libcurl()

    logging.info("Daemon ready")
コード例 #4
0
def finish_startup_after_config():
    """Finish startup tasks once we have config setup.

    Called from command.InitialConfigCommand.
    """

    from miro import gtcache
    gtcache.init()

    from miro import httpclient
    from miro.dl_daemon import download
    download.startup()
    httpclient.init_libcurl()

    logging.info("Daemon ready")
コード例 #5
0
ファイル: __init__.py プロジェクト: cool-RR/Miro
 def before_run(self):
     # libcurl can only be initialized/cleaned up once per run, so this code
     # can't go in the setUp/tearDown methosd.
     httpclient.init_libcurl()
コード例 #6
0
 def before_run(self):
     # libcurl can only be initialized/cleaned up once per run, so this code
     # can't go in the setUp/tearDown methosd.
     httpclient.init_libcurl()