| OLD | NEW |
| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 shell: The shell that is being configured. | 173 shell: The shell that is being configured. |
| 174 shell_arguments: Current list of shell arguments. | 174 shell_arguments: Current list of shell arguments. |
| 175 dev_server_config: Instance of shell_config.DevServerConfig describing the | 175 dev_server_config: Instance of shell_config.DevServerConfig describing the |
| 176 dev server to be set up. | 176 dev server to be set up. |
| 177 | 177 |
| 178 Returns: | 178 Returns: |
| 179 The updated argument list. | 179 The updated argument list. |
| 180 """ | 180 """ |
| 181 server_url = shell.serve_local_directories(dev_server_config.mappings) | 181 server_url = shell.serve_local_directories(dev_server_config.mappings) |
| 182 shell_args.append('--map-origin=%s=%s' % (dev_server_config.host, server_url)) | 182 shell_args.append('--map-origin=%s=%s' % (dev_server_config.host, server_url)) |
| 183 print "Configured %s locally as %s" % (dev_server_config.host, server_url) | 183 print "Configured %s locally to serve:" % (dev_server_config.host) |
| 184 for mapping_prefix, mapping_path in dev_server_config.mappings: | 184 for mapping_prefix, mapping_path in dev_server_config.mappings: |
| 185 print " /%s -> %s" % (mapping_prefix, mapping_path) | 185 print " /%s -> %s" % (mapping_prefix, mapping_path) |
| 186 return shell_args | 186 return shell_args |
| 187 | 187 |
| 188 | 188 |
| 189 def get_shell(shell_config, shell_args): | 189 def get_shell(shell_config, shell_args): |
| 190 """ | 190 """ |
| 191 Produces a shell abstraction configured according to |shell_config|. | 191 Produces a shell abstraction configured according to |shell_config|. |
| 192 | 192 |
| 193 Args: | 193 Args: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 shell_args.extend(configure_local_origin(shell, shell_config.origin, | 234 shell_args.extend(configure_local_origin(shell, shell_config.origin, |
| 235 fixed_port=True)) | 235 fixed_port=True)) |
| 236 | 236 |
| 237 if shell_config.sky: | 237 if shell_config.sky: |
| 238 shell_args = _configure_sky(shell_args) | 238 shell_args = _configure_sky(shell_args) |
| 239 | 239 |
| 240 for dev_server_config in shell_config.dev_servers: | 240 for dev_server_config in shell_config.dev_servers: |
| 241 shell_args = _configure_dev_server(shell, shell_args, dev_server_config) | 241 shell_args = _configure_dev_server(shell, shell_args, dev_server_config) |
| 242 | 242 |
| 243 return shell, shell_args | 243 return shell, shell_args |
| OLD | NEW |