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

Unified Diff: Source/bindings/scripts/utilities.py

Issue 309793002: IDL build: Split global objects computation from global constructors computation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweak Created 6 years, 7 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
Index: Source/bindings/scripts/utilities.py
diff --git a/Source/bindings/scripts/utilities.py b/Source/bindings/scripts/utilities.py
index 7a7a3e69f874fd98a634b871080dc63a363aad05..34bcad53400083ac6371947f0e9ccb7841974229 100644
--- a/Source/bindings/scripts/utilities.py
+++ b/Source/bindings/scripts/utilities.py
@@ -18,6 +18,11 @@ class IdlBadFilenameError(Exception):
pass
+def idl_filename_to_interface_name(idl_filename):
+ # interface name is the root of the basename: InterfaceName.idl
+ return os.path.splitext(os.path.basename(idl_filename))[0]
+
+
################################################################################
# Basic file reading/writing
################################################################################
@@ -27,6 +32,12 @@ def get_file_contents(filename):
return f.read()
+def read_file_to_list(filename):
+ """Returns a list of (stripped) lines for a given filename."""
+ with open(filename) as f:
+ return [line.rstrip('\n') for line in f]
+
+
def write_file(new_text, destination_filename, only_if_changed):
if only_if_changed and os.path.isfile(destination_filename):
with open(destination_filename) as destination_file:

Powered by Google App Engine
This is Rietveld 408576698