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

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

Issue 189543008: Factor abstract base class IDLCompiler, concrete class IDLComplierV8 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: get_file_contents() Created 6 years, 9 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 | « Source/bindings/scripts/idl_compiler.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/utilities.py
diff --git a/Source/bindings/scripts/utilities.py b/Source/bindings/scripts/utilities.py
index 10679d46d211f002fbbec25c64556ed8ae47e328..02b973ff98cfb6e55658feca66a3a6f73ffc396e 100644
--- a/Source/bindings/scripts/utilities.py
+++ b/Source/bindings/scripts/utilities.py
@@ -21,16 +21,16 @@ class IdlBadFilenameError(Exception):
def get_file_contents(filename):
with open(filename) as f:
- return ''.join(f.readlines())
+ return f.read()
-def write_file(new_lines, destination_filename, only_if_changed):
+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:
- if destination_file.readlines() == new_lines:
+ if destination_file.read() == new_text:
return
with open(destination_filename, 'w') as destination_file:
- destination_file.write(''.join(new_lines))
+ destination_file.write(new_text)
def write_pickle_file(pickle_filename, data, only_if_changed):
« no previous file with comments | « Source/bindings/scripts/idl_compiler.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698