OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Provides a convenient wrapper for spawning a test lighttpd instance. | 6 """Provides a convenient wrapper for spawning a test lighttpd instance. |
M-A Ruel
2011/11/23 03:17:45
Please note that there is already a test server in
michaelbai
2011/11/23 17:55:07
Thanks for the information, this issue has been di
| |
7 | 7 |
8 Usage: | 8 Usage: |
9 lighttpd_server PATH_TO_DOC_ROOT | 9 lighttpd_server PATH_TO_DOC_ROOT |
10 """ | 10 """ |
11 | 11 |
12 import codecs | 12 import codecs |
13 import contextlib | 13 import contextlib |
14 import httplib | 14 import httplib |
15 import os | 15 import os |
16 import pexpect | 16 import pexpect |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 raw_input('Server running at http://127.0.0.1:%s -' | 225 raw_input('Server running at http://127.0.0.1:%s -' |
226 ' press Enter to exit it.' % server.port) | 226 ' press Enter to exit it.' % server.port) |
227 else: | 227 else: |
228 print 'Server exit code:', server.process.exitstatus | 228 print 'Server exit code:', server.process.exitstatus |
229 finally: | 229 finally: |
230 server.ShutdownHttpServer() | 230 server.ShutdownHttpServer() |
231 | 231 |
232 | 232 |
233 if __name__ == '__main__': | 233 if __name__ == '__main__': |
234 sys.exit(main(sys.argv)) | 234 sys.exit(main(sys.argv)) |
OLD | NEW |