| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # The gyp "branding" variable. | 23 # The gyp "branding" variable. |
| 22 BRANDING = None | 24 BRANDING = None |
| 23 | 25 |
| 24 # Some build paths defined by gyp. | 26 # Some build paths defined by gyp. |
| 25 GRIT_DIR = None | 27 GRIT_DIR = None |
| 26 SHARE_INT_DIR = None | 28 SHARE_INT_DIR = None |
| 27 INT_DIR = None | 29 INT_DIR = None |
| 28 | 30 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 290 |
| 289 if print_outputs: | 291 if print_outputs: |
| 290 return list_outputs(locales) | 292 return list_outputs(locales) |
| 291 | 293 |
| 292 return repack_locales(locales) | 294 return repack_locales(locales) |
| 293 | 295 |
| 294 if __name__ == '__main__': | 296 if __name__ == '__main__': |
| 295 results = DoMain(sys.argv[1:]) | 297 results = DoMain(sys.argv[1:]) |
| 296 if results: | 298 if results: |
| 297 print results | 299 print results |
| OLD | NEW |