| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (C) 2013 Google Inc. All rights reserved. | 2 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 filters = { | 57 filters = { |
| 58 'cpp_name': name_utilities.cpp_name, | 58 'cpp_name': name_utilities.cpp_name, |
| 59 'enable_conditional': name_utilities.enable_conditional_if_endif, | 59 'enable_conditional': name_utilities.enable_conditional_if_endif, |
| 60 'lower_first': name_utilities.lower_first, | 60 'lower_first': name_utilities.lower_first, |
| 61 'case_insensitive_matching': case_insensitive_matching, | 61 'case_insensitive_matching': case_insensitive_matching, |
| 62 'script_name': name_utilities.script_name, | 62 'script_name': name_utilities.script_name, |
| 63 } | 63 } |
| 64 | 64 |
| 65 def __init__(self, in_file_path): | 65 def __init__(self, in_file_path): |
| 66 super(EventFactoryWriter, self).__init__(in_file_path) | 66 super(EventFactoryWriter, self).__init__(in_file_path) |
| 67 if self.namespace == 'EventTarget': | |
| 68 return | |
| 69 self._outputs[(self.namespace + self.suffix + ".cpp")] = self.generate_i
mplementation | |
| 70 | |
| 71 @template_expander.use_jinja('EventFactory.cpp.tmpl', filters=filters) | |
| 72 def generate_implementation(self): | |
| 73 return { | |
| 74 'namespace': self.namespace, | |
| 75 'suffix': self.suffix, | |
| 76 'events': self.in_file.name_dictionaries, | |
| 77 } | |
| 78 | |
| 79 | 67 |
| 80 if __name__ == "__main__": | 68 if __name__ == "__main__": |
| 81 name_macros.Maker(EventFactoryWriter).main(sys.argv) | 69 name_macros.Maker(EventFactoryWriter).main(sys.argv) |
| OLD | NEW |