| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 from skypy.skyserver import SkyServer | 6 from skypy.skyserver import SkyServer |
| 7 import argparse | 7 import argparse |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| 11 import re | 11 import re |
| 12 import signal | 12 import signal |
| 13 import subprocess | 13 import subprocess |
| 14 import sys | 14 import sys |
| 15 import time | 15 import time |
| 16 import urlparse | 16 import urlparse |
| 17 | 17 |
| 18 SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) | 18 SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 19 SKY_ROOT = os.path.dirname(SKY_TOOLS_DIR) | 19 SKY_ROOT = os.path.dirname(SKY_TOOLS_DIR) |
| 20 SRC_ROOT = os.path.dirname(SKY_ROOT) | 20 SRC_ROOT = os.path.dirname(SKY_ROOT) |
| 21 | 21 |
| 22 SKY_SERVER_PORT = 9888 | 22 SKY_SERVER_PORT = 9888 |
| 23 DEFAULT_URL = "sky://domokit.github.io/home" | 23 DEFAULT_URL = "sky://domokit.github.io/sky_home" |
| 24 APK_NAME = 'SkyDemo.apk' | 24 APK_NAME = 'SkyDemo.apk' |
| 25 ADB_PATH = os.path.join(SRC_ROOT, | 25 ADB_PATH = os.path.join(SRC_ROOT, |
| 26 'third_party/android_tools/sdk/platform-tools/adb') | 26 'third_party/android_tools/sdk/platform-tools/adb') |
| 27 ANDROID_PACKAGE = "org.domokit.sky.demo" | 27 ANDROID_PACKAGE = "org.domokit.sky.demo" |
| 28 | 28 |
| 29 PID_FILE_PATH = "/tmp/skydemo.pids" | 29 PID_FILE_PATH = "/tmp/skydemo.pids" |
| 30 PID_FILE_KEYS = frozenset([ | 30 PID_FILE_KEYS = frozenset([ |
| 31 'remote_sky_server_port', | 31 'remote_sky_server_port', |
| 32 'sky_server_pid', | 32 'sky_server_pid', |
| 33 'sky_server_port', | 33 'sky_server_port', |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 args = parser.parse_args() | 310 args = parser.parse_args() |
| 311 pids = Pids.read_from(PID_FILE_PATH, PID_FILE_KEYS) | 311 pids = Pids.read_from(PID_FILE_PATH, PID_FILE_KEYS) |
| 312 exit_code = args.func(args, pids) | 312 exit_code = args.func(args, pids) |
| 313 # We could do this with an at-exit handler instead? | 313 # We could do this with an at-exit handler instead? |
| 314 pids.write_to(PID_FILE_PATH) | 314 pids.write_to(PID_FILE_PATH) |
| 315 sys.exit(exit_code) | 315 sys.exit(exit_code) |
| 316 | 316 |
| 317 | 317 |
| 318 if __name__ == '__main__': | 318 if __name__ == '__main__': |
| 319 SkyShellRunner().main() | 319 SkyShellRunner().main() |
| OLD | NEW |