Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: Source/core/scripts/make_style_shorthands.py

Issue 22546004: Remove .tmpl extension from Jinja templates in core Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (C) 2013 Intel Corporation. All rights reserved. 2 # Copyright (C) 2013 Intel Corporation. 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 self._longhand_dictionary[longhand].append(property) 63 self._longhand_dictionary[longhand].append(property)
64 self._properties = dict((property["property_id"], property) for property in self._properties) 64 self._properties = dict((property["property_id"], property) for property in self._properties)
65 65
66 # FIXME: some of these might be better in a utils file 66 # FIXME: some of these might be better in a utils file
67 def _camelcase_property_name(self, property_name): 67 def _camelcase_property_name(self, property_name):
68 return re.sub(r'(^[^-])|-(.)', lambda match: (match.group(1) or match.gr oup(2)).upper(), property_name) 68 return re.sub(r'(^[^-])|-(.)', lambda match: (match.group(1) or match.gr oup(2)).upper(), property_name)
69 69
70 def _create_css_property_name_enum_value(self, property_name): 70 def _create_css_property_name_enum_value(self, property_name):
71 return "CSSProperty" + property_name 71 return "CSSProperty" + property_name
72 72
73 @template_expander.use_jinja("StylePropertyShorthand.cpp.tmpl") 73 @template_expander.use_jinja("StylePropertyShorthand.cpp")
74 def generate_style_property_shorthand_cpp(self): 74 def generate_style_property_shorthand_cpp(self):
75 return { 75 return {
76 "properties": self._properties, 76 "properties": self._properties,
77 "longhands_dictionary": self._longhand_dictionary, 77 "longhands_dictionary": self._longhand_dictionary,
78 } 78 }
79 79
80 @template_expander.use_jinja("StylePropertyShorthand.h.tmpl") 80 @template_expander.use_jinja("StylePropertyShorthand.h")
81 def generate_style_property_shorthand_h(self): 81 def generate_style_property_shorthand_h(self):
82 return { 82 return {
83 "properties": self._properties, 83 "properties": self._properties,
84 } 84 }
85 85
86 if __name__ == "__main__": 86 if __name__ == "__main__":
87 in_generator.Maker(StylePropertyShorthandWriter).main(sys.argv) 87 in_generator.Maker(StylePropertyShorthandWriter).main(sys.argv)
OLDNEW
« no previous file with comments | « Source/core/scripts/make_style_builder.py ('k') | Source/core/scripts/templates/InternalRuntimeFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698