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

Side by Side Diff: mojo/devtools/common/devtoolslib/shell_arguments.py

Issue 1316443002: Call `gzip` in subprocess instead of gzipping in Python in http_server. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address Piotr's comments. Created 5 years, 3 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
« no previous file with comments | « mojo/devtools/common/devtoolslib/http_server.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Produces configured shell abstractions. 5 """Produces configured shell abstractions.
6 6
7 This module knows how to produce a configured shell abstraction based on 7 This module knows how to produce a configured shell abstraction based on
8 shell_config.ShellConfig. 8 shell_config.ShellConfig.
9 """ 9 """
10 10
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 shell: The shell that is being configured. 152 shell: The shell that is being configured.
153 shell_arguments: Current list of shell arguments. 153 shell_arguments: Current list of shell arguments.
154 dev_server_config: Instance of shell_config.DevServerConfig describing the 154 dev_server_config: Instance of shell_config.DevServerConfig describing the
155 dev server to be set up. 155 dev server to be set up.
156 156
157 Returns: 157 Returns:
158 The updated argument list. 158 The updated argument list.
159 """ 159 """
160 server_url = shell.serve_local_directories(dev_server_config.mappings) 160 server_url = shell.serve_local_directories(dev_server_config.mappings)
161 shell_args.append('--map-origin=%s=%s' % (dev_server_config.host, server_url)) 161 shell_args.append('--map-origin=%s=%s' % (dev_server_config.host, server_url))
162 print "Configured %s locally to serve:" % (dev_server_config.host) 162 print "Configured %s locally at %s to serve:" % (dev_server_config.host,
163 server_url)
163 for mapping_prefix, mapping_path in dev_server_config.mappings: 164 for mapping_prefix, mapping_path in dev_server_config.mappings:
164 print " /%s -> %s" % (mapping_prefix, mapping_path) 165 print " /%s -> %s" % (mapping_prefix, mapping_path)
165 return shell_args 166 return shell_args
166 167
167 168
168 def get_shell(shell_config, shell_args): 169 def get_shell(shell_config, shell_args):
169 """ 170 """
170 Produces a shell abstraction configured according to |shell_config|. 171 Produces a shell abstraction configured according to |shell_config|.
171 172
172 Args: 173 Args:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 for (mime_type, 219 for (mime_type,
219 content_handler_url) in shell_config.content_handlers.iteritems(): 220 content_handler_url) in shell_config.content_handlers.iteritems():
220 shell_args = append_to_argument(shell_args, '--content-handlers=', 221 shell_args = append_to_argument(shell_args, '--content-handlers=',
221 '%s,%s' % (mime_type, 222 '%s,%s' % (mime_type,
222 content_handler_url)) 223 content_handler_url))
223 224
224 for dev_server_config in shell_config.dev_servers: 225 for dev_server_config in shell_config.dev_servers:
225 shell_args = _configure_dev_server(shell, shell_args, dev_server_config) 226 shell_args = _configure_dev_server(shell, shell_args, dev_server_config)
226 227
227 return shell, shell_args 228 return shell, shell_args
OLDNEW
« no previous file with comments | « mojo/devtools/common/devtoolslib/http_server.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698