| 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 os | 7 import os |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 import urlparse | 10 import urlparse |
| 11 | 11 |
| 12 | 12 |
| 13 BUILD_DIRECTORY = 'out' | 13 BUILD_DIRECTORY = 'out' |
| 14 CONFIG_DIRECTORY = 'Debug' | 14 CONFIG_DIRECTORY = 'Debug' |
| 15 MOJO_SHELL_PATH = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, | 15 MOJO_SHELL_PATH = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, |
| 16 os.pardir, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'mojo_shell')) | 16 os.pardir, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'mojo_shell')) |
| 17 | 17 |
| 18 SUPPORTED_MIME_TYPES = [ | 18 SUPPORTED_MIME_TYPES = [ |
| 19 'text/html', | 19 'text/html', |
| 20 'text/sky', |
| 20 'text/plain', | 21 'text/plain', |
| 21 ] | 22 ] |
| 22 | 23 |
| 23 def start_http_server_for_file(path): | 24 def start_http_server_for_file(path): |
| 24 HTTP_PORT = 9999 | 25 HTTP_PORT = 9999 |
| 25 directory = os.path.dirname(os.path.abspath(path)) | 26 directory = os.path.dirname(os.path.abspath(path)) |
| 26 server_command = [ | 27 server_command = [ |
| 27 'python', | 28 'python', |
| 28 '-m', | 29 '-m', |
| 29 'SimpleHTTPServer', | 30 'SimpleHTTPServer', |
| (...skipping 27 matching lines...) Expand all Loading... |
| 57 shell_command.append(prompt_args) | 58 shell_command.append(prompt_args) |
| 58 if args.gdb: | 59 if args.gdb: |
| 59 shell_command = ['gdb', '--args'] + shell_command | 60 shell_command = ['gdb', '--args'] + shell_command |
| 60 | 61 |
| 61 print ' '.join(shell_command) | 62 print ' '.join(shell_command) |
| 62 subprocess.check_call(shell_command) | 63 subprocess.check_call(shell_command) |
| 63 | 64 |
| 64 | 65 |
| 65 if __name__ == '__main__': | 66 if __name__ == '__main__': |
| 66 main() | 67 main() |
| OLD | NEW |