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

Unified Diff: depot_tools/gcl.py

Issue 99072: Add an optional flag to gcl.ReadFile() so that presubmit can support CRLF PRE... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/tools/
Patch Set: Created 11 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 | depot_tools/presubmit.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: depot_tools/gcl.py
===================================================================
--- depot_tools/gcl.py (revision 14622)
+++ depot_tools/gcl.py (working copy)
@@ -17,6 +17,10 @@
import upload
import urllib2
+
+__version__ = '1.0'
+
+
CODEREVIEW_SETTINGS = {
# Default values.
"CODE_REVIEW_SERVER": "codereview.chromium.org",
@@ -199,9 +203,9 @@
return RunShellWithReturnCode(command, print_output)[0]
-def ReadFile(filename):
+def ReadFile(filename, flags='r'):
"""Returns the contents of a file."""
- file = open(filename, 'r')
+ file = open(filename, flags)
result = file.read()
file.close()
return result
@@ -572,6 +576,7 @@
print (
"""GCL is a wrapper for Subversion that simplifies working with groups of files.
+version """ + __version__ + """
Basic commands:
-----------------------------------------
« no previous file with comments | « no previous file | depot_tools/presubmit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698