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 hashlib | 8 import hashlib |
9 import json | 9 import json |
10 import logging | 10 import logging |
11 import os | 11 import os |
12 import pipes | 12 import pipes |
13 import platform | 13 import platform |
14 import re | 14 import re |
15 import signal | 15 import signal |
16 import subprocess | 16 import subprocess |
17 import sys | 17 import sys |
18 import tempfile | 18 import tempfile |
19 import time | 19 import time |
20 import urlparse | 20 import urlparse |
21 | 21 |
22 SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) | 22 SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) |
23 SKY_ROOT = os.path.dirname(SKY_TOOLS_DIR) | 23 SKY_ROOT = os.path.dirname(SKY_TOOLS_DIR) |
24 SRC_ROOT = os.path.dirname(SKY_ROOT) | 24 SRC_ROOT = os.path.dirname(SKY_ROOT) |
25 | 25 |
26 GDB_PORT = 8888 | 26 GDB_PORT = 8888 |
27 SKY_SERVER_PORT = 9888 | 27 SKY_SERVER_PORT = 9888 |
28 OBSERVATORY_PORT = 8181 | 28 OBSERVATORY_PORT = 8181 |
29 DEFAULT_URL = "sky://domokit.github.io/sky_home" | 29 DEFAULT_URL = "sky://domokit.github.io/home.dart" |
30 APK_NAME = 'SkyDemo.apk' | 30 APK_NAME = 'SkyDemo.apk' |
31 ADB_PATH = os.path.join(SRC_ROOT, | 31 ADB_PATH = os.path.join(SRC_ROOT, |
32 'third_party/android_tools/sdk/platform-tools/adb') | 32 'third_party/android_tools/sdk/platform-tools/adb') |
33 ANDROID_PACKAGE = "org.domokit.sky.demo" | 33 ANDROID_PACKAGE = "org.domokit.sky.demo" |
34 SHA1_PATH = '/sdcard/%s/%s.sha1' % (ANDROID_PACKAGE, APK_NAME) | 34 SHA1_PATH = '/sdcard/%s/%s.sha1' % (ANDROID_PACKAGE, APK_NAME) |
35 | 35 |
36 PID_FILE_PATH = "/tmp/skydemo.pids" | 36 PID_FILE_PATH = "/tmp/skydemo.pids" |
37 PID_FILE_KEYS = frozenset([ | 37 PID_FILE_KEYS = frozenset([ |
38 'remote_sky_server_port', | 38 'remote_sky_server_port', |
39 'sky_server_pid', | 39 'sky_server_pid', |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 args = parser.parse_args() | 533 args = parser.parse_args() |
534 pids = Pids.read_from(PID_FILE_PATH, PID_FILE_KEYS) | 534 pids = Pids.read_from(PID_FILE_PATH, PID_FILE_KEYS) |
535 exit_code = args.func(args, pids) | 535 exit_code = args.func(args, pids) |
536 # We could do this with an at-exit handler instead? | 536 # We could do this with an at-exit handler instead? |
537 pids.write_to(PID_FILE_PATH) | 537 pids.write_to(PID_FILE_PATH) |
538 sys.exit(exit_code) | 538 sys.exit(exit_code) |
539 | 539 |
540 | 540 |
541 if __name__ == '__main__': | 541 if __name__ == '__main__': |
542 SkyShellRunner().main() | 542 SkyShellRunner().main() |
OLD | NEW |