| 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 21 matching lines...) Expand all Loading... |
| 32 import hasher | 32 import hasher |
| 33 import in_generator | 33 import in_generator |
| 34 import name_utilities | 34 import name_utilities |
| 35 import template_expander | 35 import template_expander |
| 36 | 36 |
| 37 from in_file import InFile | 37 from in_file import InFile |
| 38 | 38 |
| 39 | 39 |
| 40 def _symbol(entry): | 40 def _symbol(entry): |
| 41 # FIXME: Remove this special case for the ugly x-webkit-foo attributes. | 41 # FIXME: Remove this special case for the ugly x-webkit-foo attributes. |
| 42 if entry['name'].startswith('x-'): | 42 if entry['name'].startswith('x-webkit-'): |
| 43 return entry['name'].replace('-', '')[1:] | 43 return entry['name'].replace('-', '')[1:] |
| 44 return entry['name'].replace('-', '_') | 44 return entry['name'].replace('-', '_') |
| 45 | 45 |
| 46 | 46 |
| 47 class MakeQualifiedNamesWriter(in_generator.Writer): | 47 class MakeQualifiedNamesWriter(in_generator.Writer): |
| 48 defaults = { | 48 defaults = { |
| 49 } | 49 } |
| 50 default_parameters = { | 50 default_parameters = { |
| 51 'attrsNullNamespace': None, | 51 'attrsNullNamespace': None, |
| 52 'namespace': '', | 52 'namespace': '', |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 def generate_header(self): | 100 def generate_header(self): |
| 101 return self._template_context | 101 return self._template_context |
| 102 | 102 |
| 103 @template_expander.use_jinja('MakeQualifiedNames.cpp.tmpl', filters=filters) | 103 @template_expander.use_jinja('MakeQualifiedNames.cpp.tmpl', filters=filters) |
| 104 def generate_implementation(self): | 104 def generate_implementation(self): |
| 105 return self._template_context | 105 return self._template_context |
| 106 | 106 |
| 107 | 107 |
| 108 if __name__ == "__main__": | 108 if __name__ == "__main__": |
| 109 in_generator.Maker(MakeQualifiedNamesWriter).main(sys.argv) | 109 in_generator.Maker(MakeQualifiedNamesWriter).main(sys.argv) |
| OLD | NEW |