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

Unified Diff: gcl.py

Issue 502066: Remove gcl.WriteFile (Closed)
Patch Set: Created 11 years 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 | tests/gcl_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
diff --git a/gcl.py b/gcl.py
index d25f9d5198b881318ec01ab0e028856023950641..90ad65a1db94f0584357c3870a0ea1e12495db42 100755
--- a/gcl.py
+++ b/gcl.py
@@ -139,7 +139,7 @@ def GetCachedFile(filename, max_age=60*60*24*3, use_root=False):
url_path = os.path.dirname(url_path)
# Write a cached version even if there isn't a file, so we don't try to
# fetch it each time.
- WriteFile(cached_file, content)
+ gclient_utils.FileWrite(cached_file, content)
else:
content = ReadFile(cached_file)
# Keep the content cached in memory.
@@ -213,13 +213,6 @@ def ReadFile(filename, flags='r'):
return result
-def WriteFile(filename, contents):
- """Overwrites the file with the given contents."""
- f = open(filename, 'w')
- f.write(contents)
- f.close()
-
-
def FilterFlag(args, flag):
"""Returns True if the flag is present in args list.
@@ -306,7 +299,7 @@ class ChangeInfo(object):
"%d, %d, %s" % (self.issue, self.patchset, needs_upload),
"\n".join([f[0] + f[1] for f in self.GetFiles()]),
self.description])
- WriteFile(GetChangelistInfoFile(self.name), data)
+ gclient_utils.FileWrite(GetChangelistInfoFile(self.name), data)
def Delete(self):
"""Removes the changelist information from disk."""
« no previous file with comments | « no previous file | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698