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

Unified Diff: build/android/gyp/util/build_utils.py

Issue 132463007: Enable presubmit pylint in build/android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase vs tot and only disabling F0401 in specific spots Created 6 years, 10 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 | « build/android/gyp/util/build_device.py ('k') | build/android/gyp/util/md5_check.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/util/build_utils.py
diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py
index 0bf94821f3fa86617446b6a779e3b4ebc37c58ea..165fa244d458048d59137f3709e50ade0c6f0574 100644
--- a/build/android/gyp/util/build_utils.py
+++ b/build/android/gyp/util/build_utils.py
@@ -10,7 +10,6 @@ import shlex
import shutil
import subprocess
import sys
-import traceback
def MakeDirectory(dir_path):
@@ -31,18 +30,18 @@ def Touch(path):
os.utime(path, None)
-def FindInDirectory(directory, filter):
+def FindInDirectory(directory, filename_filter):
files = []
- for root, dirnames, filenames in os.walk(directory):
- matched_files = fnmatch.filter(filenames, filter)
+ for root, _dirnames, filenames in os.walk(directory):
+ matched_files = fnmatch.filter(filenames, filename_filter)
files.extend((os.path.join(root, f) for f in matched_files))
return files
-def FindInDirectories(directories, filter):
+def FindInDirectories(directories, filename_filter):
all_files = []
for directory in directories:
- all_files.extend(FindInDirectory(directory, filter))
+ all_files.extend(FindInDirectory(directory, filename_filter))
return all_files
@@ -56,7 +55,9 @@ def ParseGypList(gyp_string):
return shlex.split(gyp_string)
-def CheckOptions(options, parser, required=[]):
+def CheckOptions(options, parser, required=None):
+ if not required:
+ return
for option_name in required:
if not getattr(options, option_name):
parser.error('--%s is required' % option_name.replace('_', '-'))
@@ -83,6 +84,7 @@ class CalledProcessError(Exception):
exits with a non-zero exit code."""
def __init__(self, cwd, args, output):
+ super(CalledProcessError, self).__init__()
self.cwd = cwd
self.args = args
self.output = output
@@ -129,8 +131,8 @@ def IsTimeStale(output, inputs):
return True
output_time = GetModifiedTime(output)
- for input in inputs:
- if GetModifiedTime(input) > output_time:
+ for i in inputs:
+ if GetModifiedTime(i) > output_time:
return True
return False
« no previous file with comments | « build/android/gyp/util/build_device.py ('k') | build/android/gyp/util/md5_check.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698