| 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 """ | 6 """ | 
| 7 A simple utility function to merge data pack files into a single data pack. See | 7 A simple utility function to merge data pack files into a single data pack. See | 
| 8 http://dev.chromium.org/developers/design-documents/linuxresourcesandlocalizedst
    rings | 8 http://dev.chromium.org/developers/design-documents/linuxresourcesandlocalizedst
    rings | 
| 9 for details about the file format. | 9 for details about the file format. | 
| 10 """ | 10 """ | 
| 11 | 11 | 
| 12 import optparse | 12 import optparse | 
| 13 import os | 13 import os | 
| 14 import sys | 14 import sys | 
| 15 | 15 | 
| 16 if __name__ == '__main__': | 16 if __name__ == '__main__': | 
| 17   # Prepend the grit module from the source tree so it takes precedence over | 17   # Prepend the grit module from the source tree so it takes precedence over | 
| 18   # other grit versions that might present in the search path. | 18   # other grit versions that might present in the search path. | 
| 19   sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../..')) | 19   sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../..')) | 
| 20 | 20 | 
| 21 import grit.format.data_pack | 21 import grit.format.data_pack | 
| 22 | 22 | 
| 23 | 23 | 
| 24 def main(argv): | 24 def main(argv): | 
| 25   parser = optparse.OptionParser('usage: %prog [options] <output_filename>' | 25   parser = optparse.OptionParser('usage: %prog [options] <output_filename>' | 
| 26                                  '<input_file1> [input_file2] ...') | 26                                  '<input_file1> [input_file2] ...') | 
| 27   parser.add_option('--whitelist', action='store', dest='whitelist', | 27   parser.add_option('--whitelist', action='store', dest='whitelist', | 
| 28                     default=None, help='Full path to the whitelist used to' | 28                     default=None, help='Full path to the whitelist used to' | 
| 29                     'filter output pak file resource IDs') | 29                     'filter output pak file resource IDs') | 
|  | 30   parser.add_option('--suppress-removed-key-output', action='store_true') | 
| 30   options, file_paths = parser.parse_args(argv) | 31   options, file_paths = parser.parse_args(argv) | 
| 31 | 32 | 
| 32   if len(file_paths) < 2: | 33   if len(file_paths) < 2: | 
| 33     parser.error('Please specify output and at least one input filenames') | 34     parser.error('Please specify output and at least one input filenames') | 
| 34 | 35 | 
| 35   grit.format.data_pack.RePack(file_paths[0], file_paths[1:], | 36   grit.format.data_pack.RePack( | 
| 36                                whitelist_file=options.whitelist) | 37       file_paths[0], file_paths[1:], | 
|  | 38       whitelist_file=options.whitelist, | 
|  | 39       suppress_removed_key_output=options.suppress_removed_key_output) | 
| 37 | 40 | 
| 38 if '__main__' == __name__: | 41 if '__main__' == __name__: | 
| 39   main(sys.argv[1:]) | 42   main(sys.argv[1:]) | 
| OLD | NEW | 
|---|