summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 13:39:20 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 13:39:20 +0000
commitf74689457c2b3cb82ba0229ebe55580bafa49a77 (patch)
tree903d8f4161833336be2e1f57079ec0d22ff23f68 /PRESUBMIT.py
parentd3ff5f8311401b2ddb58fcf9a59f5147ef1cd44b (diff)
downloadchromium_src-f74689457c2b3cb82ba0229ebe55580bafa49a77.zip
chromium_src-f74689457c2b3cb82ba0229ebe55580bafa49a77.tar.gz
chromium_src-f74689457c2b3cb82ba0229ebe55580bafa49a77.tar.bz2
Use input_api.ReadFile() instead of rolling out its own.
TEST=none BUG=none Review URL: http://codereview.chromium.org/118484 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rwxr-xr-xPRESUBMIT.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index e4aa750..0a20edfd 100755
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -24,18 +24,6 @@ EXCLUDED_PATHS = [
r"v8[\\\/].*",
]
-def ReadFile(path):
- """Given a path, returns the full contents of the file.
-
- Reads files in binary format.
- """
- fo = open(path, 'rb')
- try:
- contents = fo.read()
- finally:
- fo.close()
- return contents
-
def CheckChangeOnUpload(input_api, output_api):
# TODO(maruel): max_cols is temporarily disabled. Reenable once the source
@@ -100,7 +88,7 @@ def LocalChecks(input_api, output_api, max_cols=80):
# Need to read the file ourselves since AffectedFile.NewContents()
# will normalize line endings.
- contents = ReadFile(f.AbsoluteLocalPath())
+ contents = input_api.ReadFile(f)
if '\r' in contents:
cr_files.append(path)