OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 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 """Helper script to repack paks for a list of locales. | 6 """Helper script to repack paks for a list of locales. |
7 | 7 |
8 Gyp doesn't have any built-in looping capability, so this just provides a way to | 8 Gyp doesn't have any built-in looping capability, so this just provides a way to |
9 loop over a list of locales when repacking pak files, thus avoiding a | 9 loop over a list of locales when repacking pak files, thus avoiding a |
10 proliferation of mostly duplicate, cut-n-paste gyp actions. | 10 proliferation of mostly duplicate, cut-n-paste gyp actions. |
11 """ | 11 """ |
12 | 12 |
13 import optparse | 13 import optparse |
14 import os | 14 import os |
15 import sys | 15 import sys |
16 | 16 |
17 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', | 17 # Prepend the grit module from the source tree so it takes precedence over other |
18 'tools', 'grit')) | 18 # grit versions that might present in the search path. |
| 19 sys.path.insert(1, os.path.join(os.path.dirname(__file__), '..', '..', '..', |
| 20 'tools', 'grit')) |
19 from grit.format import data_pack | 21 from grit.format import data_pack |
20 | 22 |
21 # Some build paths defined by gyp. | 23 # Some build paths defined by gyp. |
22 GRIT_DIR = None | 24 GRIT_DIR = None |
23 INT_DIR = None | 25 INT_DIR = None |
24 | 26 |
25 # The target platform. If it is not defined, sys.platform will be used. | 27 # The target platform. If it is not defined, sys.platform will be used. |
26 OS = None | 28 OS = None |
27 | 29 |
28 # Extra input files. | 30 # Extra input files. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 153 |
152 if print_outputs: | 154 if print_outputs: |
153 return list_outputs(locales) | 155 return list_outputs(locales) |
154 | 156 |
155 return repack_locales(locales) | 157 return repack_locales(locales) |
156 | 158 |
157 if __name__ == '__main__': | 159 if __name__ == '__main__': |
158 results = DoMain(sys.argv[1:]) | 160 results = DoMain(sys.argv[1:]) |
159 if results: | 161 if results: |
160 print results | 162 print results |
OLD | NEW |