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

Side by Side Diff: third_party/WebKit/Source/build/scripts/make_media_features.py

Issue 2329463004: ABANDONED CL: Changes needed to make things compile after running rewrite_to_chrome_style tool. (Closed)
Patch Set: Rebasing the fixes... Created 3 years, 10 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import media_feature_symbol 7 import media_feature_symbol
8 import json5_generator 8 import json5_generator
9 import template_expander 9 import template_expander
10 import name_utilities 10 import name_utilities
11 import sys 11 import sys
12 12
13 13
14 class MakeMediaFeaturesWriter(json5_generator.Writer): 14 class MakeMediaFeaturesWriter(json5_generator.Writer):
15 default_metadata = { 15 default_metadata = {
16 'namespace': '', 16 'namespace': '',
17 'export': '', 17 'export': '',
18 } 18 }
19 filters = { 19 filters = {
20 'symbol': media_feature_symbol.getMediaFeatureSymbolWithSuffix(''), 20 'symbol': media_feature_symbol.getMediaFeatureSymbolWithSuffix(''),
21 'to_macro_style': name_utilities.to_macro_style, 21 'to_macro_style': name_utilities.to_macro_style,
22 'upper_first_letter': name_utilities.upper_first_letter,
22 } 23 }
23 24
24 def __init__(self, json5_file_path): 25 def __init__(self, json5_file_path):
25 super(MakeMediaFeaturesWriter, self).__init__(json5_file_path) 26 super(MakeMediaFeaturesWriter, self).__init__(json5_file_path)
26 27
27 self._outputs = { 28 self._outputs = {
28 ('MediaFeatures.h'): self.generate_header, 29 ('MediaFeatures.h'): self.generate_header,
29 } 30 }
30 self._template_context = { 31 self._template_context = {
31 'entries': self.json5_file.name_dictionaries, 32 'entries': self.json5_file.name_dictionaries,
32 } 33 }
33 34
34 @template_expander.use_jinja('MediaFeatures.h.tmpl', filters=filters) 35 @template_expander.use_jinja('MediaFeatures.h.tmpl', filters=filters)
35 def generate_header(self): 36 def generate_header(self):
36 return self._template_context 37 return self._template_context
37 38
38 if __name__ == '__main__': 39 if __name__ == '__main__':
39 json5_generator.Maker(MakeMediaFeaturesWriter).main() 40 json5_generator.Maker(MakeMediaFeaturesWriter).main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698