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

Unified Diff: lib/dom/scripts/fremontcutbuilder.py

Issue 10081014: 1st phasing of transition to new API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/fremontcutbuilder.py
diff --git a/lib/dom/scripts/fremontcutbuilder.py b/lib/dom/scripts/fremontcutbuilder.py
index 59505308d1f4ed6c99f13e7232836ba68f0bbb1d..845bedcb0fa63ac2d048f70b311182ab66693e65 100755
--- a/lib/dom/scripts/fremontcutbuilder.py
+++ b/lib/dom/scripts/fremontcutbuilder.py
@@ -8,7 +8,6 @@ import databasebuilder
import idlparser
import logging.config
import os.path
-import tempfile
import sys
# TODO(antonm): most probably should go away or be autogenerated on IDLs roll.
@@ -84,7 +83,7 @@ DEFAULT_FEATURE_DEFINES = [
# TODO(antonm): Remove this filter.
UNSUPPORTED_FEATURES = [ 'ENABLE_WEB_INTENTS' ]
-def build_database(idl_list_file_name, database_dir, feature_defines = None):
+def build_database(idl_files, database_dir, feature_defines = None):
"""This code reconstructs the FremontCut IDL database from W3C,
WebKit and Dart IDL files."""
current_dir = os.path.dirname(__file__)
@@ -131,12 +130,16 @@ def build_database(idl_list_file_name, database_dir, feature_defines = None):
]
# Import WebKit IDLs.
- idl_list_file = open(idl_list_file_name, 'r')
- for file_name in idl_list_file:
- file_name = file_name.strip()
- idl_file_name = os.path.join(os.path.dirname(idl_list_file_name), file_name)
- builder.import_idl_file(idl_file_name, webkit_options)
- idl_list_file.close()
+ if isinstance(idl_files, list):
+ for file_name in idl_files:
+ builder.import_idl_file(idl_file_name, webkit_options)
+ else:
+ idl_list_file = open(idl_files, 'r')
podivilov 2012/04/16 09:24:58 Is it needed for two-side patching only?
Anton Muhin 2012/04/16 09:39:38 Sorry? I just do not want to make breaking change
+ for file_name in idl_list_file:
+ file_name = file_name.strip()
+ idl_file_name = os.path.join(os.path.dirname(idl_files), file_name)
+ builder.import_idl_file(idl_file_name, webkit_options)
+ idl_list_file.close()
# Import Dart idl:
dart_options = databasebuilder.DatabaseBuilderOptions(
@@ -192,7 +195,7 @@ def main():
'xml',
]
- (idl_list_file, idl_list_file_name) = tempfile.mkstemp()
+ idl_files = []
webcore_dir = os.path.join(current_dir, '..', '..', '..',
'third_party', 'WebCore')
@@ -204,17 +207,14 @@ def main():
file_name = os.path.join(dir_name, name)
(interface, ext) = os.path.splitext(file_name)
if ext == '.idl' and not name.startswith('._'):
- path = os.path.relpath(file_name, os.path.dirname(idl_list_file_name))
- os.write(idl_list_file, '%s\n' % path)
+ idl_files.add(file_name)
for dir_name in webkit_dirs:
dir_path = os.path.join(webcore_dir, dir_name)
os.path.walk(dir_path, visitor, None)
- os.close(idl_list_file)
-
database_dir = os.path.join(current_dir, '..', 'database')
- return build_database(idl_list_file_name, database_dir)
+ return build_database(idl_files, database_dir)
if __name__ == '__main__':
sys.exit(main())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698