OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 """Downloads precompiled tools needed for video quality analysis.""" | 10 """Downloads precompiled tools.""" |
kjellander_webrtc
2017/03/03 04:33:56
Since this script is now more visible in the new l
oprypin_webrtc
2017/03/03 19:24:50
Done.
| |
11 | 11 |
12 import os | 12 import os |
13 import subprocess | 13 import subprocess |
14 import sys | 14 import sys |
15 | 15 |
16 | 16 |
17 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 17 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
18 | 18 |
19 | 19 |
20 def main(): | 20 def main(directories): |
21 cmd = [ | 21 if not directories: |
22 'download_from_google_storage', | 22 directories = [SCRIPT_DIR] |
23 '--directory', | 23 |
24 '--num_threads=10', | 24 for path in directories: |
25 '--bucket', 'chrome-webrtc-resources', | 25 cmd = [ |
26 '--auto_platform', | 26 'download_from_google_storage', |
27 '--recursive', | 27 '--directory', |
28 SCRIPT_DIR, | 28 '--num_threads=10', |
29 ] | 29 '--bucket', 'chrome-webrtc-resources', |
30 print 'Downloading video quality analysis tools...' | 30 '--auto_platform', |
31 subprocess.check_call(cmd) | 31 '--recursive', |
32 path, | |
kjellander_webrtc
2017/02/27 07:05:13
Skip the directory handling in main() + the loop a
oprypin_webrtc
2017/03/02 17:30:08
This is done so each test can specify what subdire
kjellander_webrtc
2017/03/03 04:33:56
Sure, that could be a useful feature as it works b
oprypin_webrtc
2017/03/03 19:24:50
Done.
| |
33 ] | |
34 print 'Downloading precompiled tools...' | |
35 subprocess.check_call(cmd) | |
32 | 36 |
33 | 37 |
34 if __name__ == '__main__': | 38 if __name__ == '__main__': |
35 sys.exit(main()) | 39 sys.exit(main(sys.argv[1:])) |
OLD | NEW |