| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 initPartialInterfacesInModules(), which registers partial interfaces
in modules to core interfaces.""" | 6 """Generate initPartialInterfacesInModules(), which registers partial interfaces
in modules to core interfaces.""" |
| 7 | 7 |
| 8 # pylint: disable=relative-import | 8 # pylint: disable=relative-import |
| 9 | 9 |
| 10 from optparse import OptionParser | 10 from optparse import OptionParser |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 _COPYRIGHT = """// Copyright 2014 The Chromium Authors. All rights reserved. | 22 _COPYRIGHT = """// Copyright 2014 The Chromium Authors. All rights reserved. |
| 23 // Use of this source code is governed by a BSD-style license that can be | 23 // Use of this source code is governed by a BSD-style license that can be |
| 24 // found in the LICENSE file. | 24 // found in the LICENSE file. |
| 25 """ | 25 """ |
| 26 | 26 |
| 27 _INIT_PARTIAL_INTERFACE = """%s | 27 _INIT_PARTIAL_INTERFACE = """%s |
| 28 %s | 28 %s |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 void initPartialInterfacesInModules() { | 32 void InitPartialInterfacesInModules() { |
| 33 %s | 33 %s |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace blink | 36 } // namespace blink |
| 37 """ | 37 """ |
| 38 | 38 |
| 39 | 39 |
| 40 def parse_options(): | 40 def parse_options(): |
| 41 usage = 'Usage: %prog [options]' | 41 usage = 'Usage: %prog [options]' |
| 42 parser = OptionParser(usage=usage) | 42 parser = OptionParser(usage=usage) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 content = _INIT_PARTIAL_INTERFACE % ( | 97 content = _INIT_PARTIAL_INTERFACE % ( |
| 98 _COPYRIGHT, | 98 _COPYRIGHT, |
| 99 '\n'.join(includes), | 99 '\n'.join(includes), |
| 100 '\n'.join(initialize_calls)) | 100 '\n'.join(initialize_calls)) |
| 101 | 101 |
| 102 write_file(content, options.output) | 102 write_file(content, options.output) |
| 103 | 103 |
| 104 | 104 |
| 105 if __name__ == '__main__': | 105 if __name__ == '__main__': |
| 106 sys.exit(main()) | 106 sys.exit(main()) |
| OLD | NEW |