root/galaxy-central/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/wsgiutils_server.py

リビジョン 3, 0.8 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
2# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
3from paste.script.serve import ensure_port_cleanup
4from paste.translogger import TransLogger
5
6def run_server(wsgi_app, global_conf, host='localhost',
7               port=8080):
8    from wsgiutils import wsgiServer
9    import logging
10    logged_app = TransLogger(wsgi_app)
11    port = int(port)
12    # For some reason this is problematic on this server:
13    ensure_port_cleanup([(host, port)], maxtries=2, sleeptime=0.5)
14    app_map = {'': logged_app}
15    server = wsgiServer.WSGIServer((host, port), app_map)
16    logged_app.logger.info('Starting HTTP server on http://%s:%s',
17                           host, port)
18    server.serve_forever()
19   
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。