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

Side by Side Diff: bindings/scripts/aggregate_generated_bindings.py

Issue 581453002: Dartium Roll 38 roll (Closed) Base URL: https://dart.googlecode.com/svn/third_party/WebCore
Patch Set: Sync'd w/ r 182210 Created 6 years, 3 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
« no previous file with comments | « bindings/dart/scripts/dart_utilities.py ('k') | bindings/scripts/blink_idl_lexer.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (C) 2009 Google Inc. All rights reserved. 3 # Copyright (C) 2009 Google Inc. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 def extract_conditional(idl_file_path): 114 def extract_conditional(idl_file_path):
115 """Find [Conditional] interface extended attribute.""" 115 """Find [Conditional] interface extended attribute."""
116 with open(idl_file_path) as idl_file: 116 with open(idl_file_path) as idl_file:
117 idl_contents = idl_file.read() 117 idl_contents = idl_file.read()
118 118
119 match = CONDITIONAL_PATTERN.search(idl_contents) 119 match = CONDITIONAL_PATTERN.search(idl_contents)
120 if not match: 120 if not match:
121 return None 121 return None
122 conditional = match.group(1) 122 conditional = match.group(1)
123 return re.split('([|&])', conditional) 123 return re.split('([|,])', conditional)
124 124
125 125
126 def extract_meta_data(file_paths): 126 def extract_meta_data(file_paths):
127 """Extracts conditional and interface name from each IDL file.""" 127 """Extracts conditional and interface name from each IDL file."""
128 meta_data_list = [] 128 meta_data_list = []
129 129
130 for file_path in file_paths: 130 for file_path in file_paths:
131 if not file_path.endswith('.idl'): 131 if not file_path.endswith('.idl'):
132 print 'WARNING: non-IDL file passed: "%s"' % file_path 132 print 'WARNING: non-IDL file passed: "%s"' % file_path
133 continue 133 continue
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 meta_data for meta_data in files_meta_data 227 meta_data for meta_data in files_meta_data
228 if hash(meta_data['name']) % total_partitions == partition] 228 if hash(meta_data['name']) % total_partitions == partition]
229 file_contents = generate_content(component_dir, 229 file_contents = generate_content(component_dir,
230 files_meta_data_this_partition, 230 files_meta_data_this_partition,
231 prefix) 231 prefix)
232 write_content(file_contents, file_name) 232 write_content(file_contents, file_name)
233 233
234 234
235 if __name__ == '__main__': 235 if __name__ == '__main__':
236 sys.exit(main(sys.argv)) 236 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « bindings/dart/scripts/dart_utilities.py ('k') | bindings/scripts/blink_idl_lexer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698