| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 import argparse | 6 import argparse |
| 7 import cherrypy | 7 import cherrypy |
| 8 import json | 8 import json |
| 9 import os | 9 import os |
| 10 import staticdirindex | 10 import staticdirindex |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 parser.add_argument('port', type=int) | 36 parser.add_argument('port', type=int) |
| 37 configuration.add_arguments(parser) | 37 configuration.add_arguments(parser) |
| 38 args = parser.parse_args() | 38 args = parser.parse_args() |
| 39 | 39 |
| 40 log_dir = os.path.abspath(os.getcwd()) | 40 log_dir = os.path.abspath(os.getcwd()) |
| 41 | 41 |
| 42 paths = Paths(os.path.join('out', args.configuration)) | 42 paths = Paths(os.path.join('out', args.configuration)) |
| 43 | 43 |
| 44 config = { | 44 config = { |
| 45 'global': { | 45 'global': { |
| 46 # Cherrypy appears to just drop requests if it doesn't have |
| 47 # a thread to service them, so set our thread_pool high enough |
| 48 # so that a z620 can run all the tests w/o timeouts. |
| 49 'server.thread_pool': 30, |
| 46 'server.socket_port': args.port, | 50 'server.socket_port': args.port, |
| 47 'tools.staticdir.content_types' : { | 51 'tools.staticdir.content_types' : { |
| 48 'sky': 'text/sky', | 52 'sky': 'text/sky', |
| 49 }, | 53 }, |
| 50 'log.screen': args.verbose, | 54 'log.screen': args.verbose, |
| 51 'log.access_log': os.path.join(log_dir, 'access_log.txt'), | 55 'log.access_log': os.path.join(log_dir, 'access_log.txt'), |
| 52 # This causes some strange python exception?? | 56 # This causes some strange python exception?? |
| 53 # 'log.error_log': os.path.join(log_dir, 'error_log.txt'), | 57 # 'log.error_log': os.path.join(log_dir, 'error_log.txt'), |
| 54 }, | 58 }, |
| 55 '/': { | 59 '/': { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 68 '/sky/services': { | 72 '/sky/services': { |
| 69 'tools.staticdir.on': True, | 73 'tools.staticdir.on': True, |
| 70 'tools.staticdir.dir': os.path.join(paths.gen_root, 'sky', 'services
'), | 74 'tools.staticdir.dir': os.path.join(paths.gen_root, 'sky', 'services
'), |
| 71 }, | 75 }, |
| 72 } | 76 } |
| 73 cherrypy.quickstart(config=config) | 77 cherrypy.quickstart(config=config) |
| 74 | 78 |
| 75 | 79 |
| 76 if __name__ == '__main__': | 80 if __name__ == '__main__': |
| 77 main() | 81 main() |
| OLD | NEW |