| 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 logging | 7 import logging |
| 8 import sys | 8 import sys |
| 9 import os.path | 9 import os.path |
| 10 import subprocess | 10 import subprocess |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 # correct shebang. | 138 # correct shebang. |
| 139 args = shell_arguments.AppendToArgument(args, '--content-handlers=', | 139 args = shell_arguments.AppendToArgument(args, '--content-handlers=', |
| 140 'text/sky,mojo:sky_viewer') | 140 'text/sky,mojo:sky_viewer') |
| 141 args = shell_arguments.AppendToArgument(args, '--content-handlers=', | 141 args = shell_arguments.AppendToArgument(args, '--content-handlers=', |
| 142 'application/dart,mojo:sky_viewer') | 142 'application/dart,mojo:sky_viewer') |
| 143 | 143 |
| 144 # Configure the window manager to embed the sky_viewer. | 144 # Configure the window manager to embed the sky_viewer. |
| 145 sky_url = server_url + launcher_args.sky | 145 sky_url = server_url + launcher_args.sky |
| 146 args.append('mojo:window_manager %s' % sky_url) | 146 args.append('mojo:window_manager %s' % sky_url) |
| 147 | 147 |
| 148 # Download Sky assets if needed. | |
| 149 sky_lib_dir = os.path.join(paths.build_dir, 'gen', 'dart-pkg', 'sky', 'lib') | |
| 150 sky_icons_dir = os.path.join(sky_lib_dir, 'assets', 'material-design-icons') | |
| 151 if not os.path.isdir(sky_icons_dir): | |
| 152 logging.info('NOTE: sky/assets/material-design-icons missing, ' | |
| 153 'Running `download_material_design_icons` for you.') | |
| 154 subprocess.check_call([os.path.join(sky_lib_dir, | |
| 155 'download_material_design_icons')]) | |
| 156 | |
| 157 if launcher_args.verbose: | 148 if launcher_args.verbose: |
| 158 print "Shell arguments: " + str(args) | 149 print "Shell arguments: " + str(args) |
| 159 | 150 |
| 160 shell.Run(args) | 151 shell.Run(args) |
| 161 return 0 | 152 return 0 |
| 162 | 153 |
| 163 | 154 |
| 164 if __name__ == "__main__": | 155 if __name__ == "__main__": |
| 165 sys.exit(main()) | 156 sys.exit(main()) |
| OLD | NEW |