OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 """Generate a C++ header from ibus_input_methods.txt. | 6 """Generate a C++ header from ibus_input_methods.txt. |
7 | 7 |
8 This program generates a C++ header file containing the information on | 8 This program generates a C++ header file containing the information on |
9 available ibus engines. It parses ibus_input_methods.txt, and then | 9 available ibus engines. It parses ibus_input_methods.txt, and then |
10 generates a static array definition from the information extracted. The | 10 generates a static array definition from the information extracted. The |
11 input and output file names are specified on the command line. | 11 input and output file names are specified on the command line. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 engine['if'] = columns[3] | 115 engine['if'] = columns[3] |
116 engines.append(engine) | 116 engines.append(engine) |
117 | 117 |
118 output = CreateEngineHeader(engines) | 118 output = CreateEngineHeader(engines) |
119 output_file = open(sys.argv[2], 'w') | 119 output_file = open(sys.argv[2], 'w') |
120 output_file.write(output) | 120 output_file.write(output) |
121 | 121 |
122 | 122 |
123 if __name__ == '__main__': | 123 if __name__ == '__main__': |
124 main(sys.argv) | 124 main(sys.argv) |
OLD | NEW |