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

Side by Side Diff: third_party/liblouis/liblouis_list_tables.py

Issue 589133002: Make undefined Unicode characters show up in a nicer way in braille. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moretables
Patch Set: Fix typo. Created 6 years, 2 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
« no previous file with comments | « third_party/liblouis/cvox-common.cti ('k') | third_party/liblouis/liblouis_nacl.gyp » ('j') | 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 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 import os 6 import os
7 import re 7 import re
8 import sys 8 import sys
9 9
10 import json 10 import json
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 ProcessFile(output_set, include_file, directories) 59 ProcessFile(output_set, include_file, directories)
60 60
61 61
62 def DoMain(argv): 62 def DoMain(argv):
63 "Entry point for gyp's pymod_do_main command." 63 "Entry point for gyp's pymod_do_main command."
64 parser = optparse.OptionParser() 64 parser = optparse.OptionParser()
65 # Give a clearer error message when this is used as a module. 65 # Give a clearer error message when this is used as a module.
66 parser.prog = 'liblouis_list_tables' 66 parser.prog = 'liblouis_list_tables'
67 parser.set_usage('usage: %prog [options] listfile') 67 parser.set_usage('usage: %prog [options] listfile')
68 parser.add_option('-D', '--directory', dest='directories', 68 parser.add_option('-D', '--directory', dest='directories',
69 action='append', help='Where to search for table files') 69 action='append', help='Where to search for table files')
70 parser.add_option('-e', '--extra_file', dest='extra_files', action='append',
71 default=[], help='Extra liblouis table file to process')
70 (options, args) = parser.parse_args(argv) 72 (options, args) = parser.parse_args(argv)
71 73
72 if len(args) != 1: 74 if len(args) != 1:
73 parser.error('Expecting exactly one argument') 75 parser.error('Expecting exactly one argument')
74 if not options.directories: 76 if not options.directories:
75 parser.error('At least one --directory option must be specified') 77 parser.error('At least one --directory option must be specified')
76 78
77 tables = LoadTablesFile(args[0]) 79 tables = LoadTablesFile(args[0])
78 output_set = set() 80 output_set = set()
79 for table in tables: 81 for table in tables:
80 ProcessFile(output_set, table['fileName'], options.directories) 82 for name in table['fileNames'].split(','):
83 ProcessFile(output_set, name, options.directories)
84 for name in options.extra_files:
85 ProcessFile(output_set, name, options.directories)
81 return '\n'.join(output_set) 86 return '\n'.join(output_set)
82 87
83 88
84 def main(argv): 89 def main(argv):
85 print DoMain(argv[1:]) 90 print DoMain(argv[1:])
86 91
87 92
88 if __name__ == '__main__': 93 if __name__ == '__main__':
89 try: 94 try:
90 sys.exit(main(sys.argv)) 95 sys.exit(main(sys.argv))
91 except KeyboardInterrupt: 96 except KeyboardInterrupt:
92 Error('interrupted') 97 Error('interrupted')
OLDNEW
« no previous file with comments | « third_party/liblouis/cvox-common.cti ('k') | third_party/liblouis/liblouis_nacl.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698