コード例 #1
0
ファイル: __init__.py プロジェクト: sardeie/anki-sync-server
def server_runner(app, global_conf, **kw):
    """ Special version of paste.httpserver.server_runner which calls 
    AnkiServer.threading.shutdown() on server exit."""

    from paste.httpserver import server_runner as paste_server_runner
    from AnkiServer.threading import shutdown
    try:
        paste_server_runner(app, global_conf, **kw)
    finally:
        shutdown()
コード例 #2
0
ファイル: __init__.py プロジェクト: geeljire/anki-sync-server
def server_runner(app, global_conf, **kw):
    """ Special version of paste.httpserver.server_runner which calls 
    AnkiServer.threading.shutdown() on server exit."""

    from paste.httpserver import server_runner as paste_server_runner
    from AnkiServer.threading import shutdown
    try:
        paste_server_runner(app, global_conf, **kw)
    finally:
        shutdown()
コード例 #3
0
def main():
    from wsgiref.simple_server import make_server
    from AnkiServer.threading import shutdown

    ankiserver = SyncApp()
    httpd = make_server('', 8001, ankiserver)
    try:
        print "Starting..."
        httpd.serve_forever()
    except KeyboardInterrupt:
        print "Exiting ..."
    finally:
        shutdown()
コード例 #4
0
def main():
    from wsgiref.simple_server import make_server
    from AnkiServer.threading import shutdown

    ankiserver = SyncApp()
    httpd = make_server('', 8001, ankiserver)
    try:
        print "Starting..."
        httpd.serve_forever()
    except KeyboardInterrupt:
        print "Exiting ..."
    finally:
        shutdown()