Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: devserver.py

Issue 6425002: devserver: allow calling devserver from anywhere (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dev-util.git@master
Patch Set: . Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | devserver_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """A CherryPy-based webserver to host images and build packages.""" 7 """A CherryPy-based webserver to host images and build packages."""
8 8
9 import cherrypy 9 import cherrypy
10 import optparse 10 import optparse
(...skipping 12 matching lines...) Expand all
23 23
24 def _GetConfig(options): 24 def _GetConfig(options):
25 """Returns the configuration for the devserver.""" 25 """Returns the configuration for the devserver."""
26 base_config = { 'global': 26 base_config = { 'global':
27 { 'server.log_request_headers': True, 27 { 'server.log_request_headers': True,
28 'server.protocol_version': 'HTTP/1.1', 28 'server.protocol_version': 'HTTP/1.1',
29 'server.socket_host': '0.0.0.0', 29 'server.socket_host': '0.0.0.0',
30 'server.socket_port': int(options.port), 30 'server.socket_port': int(options.port),
31 'server.socket_timeout': 6000, 31 'server.socket_timeout': 6000,
32 'response.timeout': 6000, 32 'response.timeout': 6000,
33 'tools.staticdir.root': os.getcwd(), 33 'tools.staticdir.root':
34 os.path.dirname(os.path.abspath(sys.argv[0])),
34 }, 35 },
35 '/build': 36 '/build':
36 { 37 {
37 'response.timeout': 100000, 38 'response.timeout': 100000,
38 }, 39 },
39 '/update': 40 '/update':
40 { 41 {
41 # Gets rid of cherrypy parsing post file for args. 42 # Gets rid of cherrypy parsing post file for args.
42 'request.process_request_body': False, 43 'request.process_request_body': False,
43 'response.timeout': 10000, 44 'response.timeout': 10000,
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 # We don't run the dev server with this option. 215 # We don't run the dev server with this option.
215 if options.validate_factory_config: 216 if options.validate_factory_config:
216 sys.exit(0) 217 sys.exit(0)
217 elif options.pregenerate_update: 218 elif options.pregenerate_update:
218 if not updater.PreGenerateUpdate(): 219 if not updater.PreGenerateUpdate():
219 sys.exit(1) 220 sys.exit(1)
220 221
221 # If the command line requested after setup, it's time to do it. 222 # If the command line requested after setup, it's time to do it.
222 if not options.exit: 223 if not options.exit:
223 cherrypy.quickstart(DevServerRoot(), config=_GetConfig(options)) 224 cherrypy.quickstart(DevServerRoot(), config=_GetConfig(options))
OLDNEW
« no previous file with comments | « no previous file | devserver_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698