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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 ASSERT_NOT_REACHED(); | 109 ASSERT_NOT_REACHED(); |
110 } | 110 } |
111 | 111 |
112 } // namespace WebCore | 112 } // namespace WebCore |
113 """ | 113 """ |
114 | 114 |
115 | 115 |
116 class ExceptionCodeDescriptionWriter(name_macros.Writer): | 116 class ExceptionCodeDescriptionWriter(name_macros.Writer): |
117 defaults = { | 117 defaults = { |
| 118 'JSInterfaceName': None, |
118 'interfaceName': None, | 119 'interfaceName': None, |
119 'conditional': None, | 120 'conditional': None, |
120 } | 121 } |
121 default_parameters = { | 122 default_parameters = { |
122 'namespace': '', | 123 'namespace': '', |
123 } | 124 } |
124 | 125 |
125 def __init__(self, in_file_path, enabled_conditions): | 126 def __init__(self, in_file_path, enabled_conditions): |
126 super(ExceptionCodeDescriptionWriter, self).__init__(in_file_path, enabl
ed_conditions) | 127 super(ExceptionCodeDescriptionWriter, self).__init__(in_file_path, enabl
ed_conditions) |
127 self._outputs[(self.class_name + ".cpp")] = self.generate_implementation | 128 self._outputs[(self.class_name + ".cpp")] = self.generate_implementation |
(...skipping 29 matching lines...) Expand all Loading... |
157 return IMPLEMENTATION_TEMPLATE % { | 158 return IMPLEMENTATION_TEMPLATE % { |
158 'license': license.license_for_generated_cpp(), | 159 'license': license.license_for_generated_cpp(), |
159 'class_name': self.class_name, | 160 'class_name': self.class_name, |
160 'includes': '\n'.join(map(self._include, self._exceptions())), | 161 'includes': '\n'.join(map(self._include, self._exceptions())), |
161 'description_initalizations': '\n'.join(map(self._description_inital
ization, self._exceptions())), | 162 'description_initalizations': '\n'.join(map(self._description_inital
ization, self._exceptions())), |
162 } | 163 } |
163 | 164 |
164 | 165 |
165 if __name__ == "__main__": | 166 if __name__ == "__main__": |
166 name_macros.Maker(ExceptionCodeDescriptionWriter).main(sys.argv) | 167 name_macros.Maker(ExceptionCodeDescriptionWriter).main(sys.argv) |
OLD | NEW |