Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: grit/format/repack.py

Issue 217273003: Add whitelist support to repack. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Whitespace fix Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« grit/format/data_pack.py ('K') | « grit/format/data_pack_unittest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 os 13 import os
13 import sys 14 import sys
15
14 if __name__ == '__main__': 16 if __name__ == '__main__':
15 sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) 17 sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
16 18
17 import grit.format.data_pack 19 import grit.format.data_pack
18 20
21
19 def main(argv): 22 def main(argv):
20 if len(argv) < 3: 23 parser = optparse.OptionParser('usage: %prog [options] <output_filename>'
21 print ("Usage:\n %s <output_filename> <input_file1> [input_file2] ... " % 24 '<input_file1> [input_file2] ...')
22 argv[0]) 25 parser.add_option('--whitelist', action='store', dest='whitelist',
23 sys.exit(-1) 26 default=None, help='Full path to the whitelist used to'
24 grit.format.data_pack.RePack(argv[1], argv[2:]) 27 'filter output pak file resource IDs')
28 options, file_paths = parser.parse_args(argv)
29
30 if len(file_paths) < 2:
31 parser.error('Please specify output and at least one input filenames')
32
33 grit.format.data_pack.RePack(file_paths[0], file_paths[1:],
34 whitelist_file=options.whitelist)
25 35
26 if '__main__' == __name__: 36 if '__main__' == __name__:
27 main(sys.argv) 37 main(sys.argv[1:])
OLDNEW
« grit/format/data_pack.py ('K') | « grit/format/data_pack_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698