~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to start-loggerhead.py

  • Committer: Michael Hudson
  • Date: 2008-06-18 07:35:18 UTC
  • mto: This revision was merged to the branch mainline in revision 164.
  • Revision ID: michael.hudson@canonical.com-20080618073518-093cb5myk2tx6hfr
more compatibility

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
                            ('server.webpath', str),
89
89
                            ('server.thread_pool', int),
90
90
                            ('server.socket_host' ,str) ]
 
91
    server_port = int(config.get('server.socket_port', 8080))
 
92
    nworkers = int(config.get('server.thread_pool', 10))
 
93
    server_host = config.get('server.socket_host', '0.0.0.0')
 
94
    webpath = config.get('server.webpath', None)
 
95
 
91
96
    for key, keytype in potential_overrides:
92
97
        value = config.get(key, None)
93
98
        if value is not None:
113
118
    app = make_middleware(app)
114
119
    app = make_filter(app, None)
115
120
 
116
 
    httpserver.serve(app, host='127.0.0.1', port='9876')
 
121
    if webpath:
 
122
        if not webpath.endswith('/'):
 
123
            webpath += '/'
 
124
        def app(environ, start_response, app=app):
 
125
            environ['SCRIPT_NAME'] = webpath
 
126
            return app(environ, start_response)
 
127
 
 
128
    httpserver.serve(app, host=server_host, port=server_port, threadpool_workers=nworkers)
117
129
 
118
130
 
119
131
if __name__ == '__main__':