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

Unified Diff: tools-webrtc/ios/generate_licenses.py

Issue 2812273002: Fix lint errors to enable stricter PyLint rules (Closed)
Patch Set: Rebased Created 3 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 | « tools-webrtc/gtest-parallel-wrapper.py ('k') | tools-webrtc/vim/webrtc.ycm_extra_conf.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools-webrtc/ios/generate_licenses.py
diff --git a/tools-webrtc/ios/generate_licenses.py b/tools-webrtc/ios/generate_licenses.py
index da09b967855f43fa7fdfa37e04daa0b96d06e64d..5c9b4cfe3be2f815a07e1e5cc36cf3af2e028568 100755
--- a/tools-webrtc/ios/generate_licenses.py
+++ b/tools-webrtc/ios/generate_licenses.py
@@ -37,16 +37,18 @@ SCRIPT_DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
CHECKOUT_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir))
WEBRTC_ROOT = os.path.join(CHECKOUT_ROOT, 'webrtc')
+
def GetThirdPartyLibraries(buildfile_dir, target_name):
- def extractLibName(s):
+ def ExtractLibName(string_list):
# Sample input:
# [" //third_party/usrsctp:usrsctp", " //webrtc:webrtc_common"]
# Sample output:
# ["usrsctp"]
- return re.sub(r'\(.*\)', '', s).strip().split(os.path.sep)[-1].split(':')[0]
+ return re.sub(r'\(.*\)', '', string_list).strip().split(
+ os.path.sep)[-1].split(':')[0]
output = subprocess.check_output(
["gn", "desc", buildfile_dir, target_name, '--all']) .split(os.linesep)
- return [extractLibName(x) for x in output if re.search(r'third_party', x)]
+ return [ExtractLibName(x) for x in output if re.search(r'third_party', x)]
class LicenseBuilder(object):
@@ -112,7 +114,7 @@ class LicenseBuilder(object):
return 0
-if __name__ == '__main__':
+def main():
parser = argparse.ArgumentParser(description='Generate WebRTC LICENSE.html')
parser.add_argument('target_name',
help='Name of the GN target to generate a license for')
@@ -123,3 +125,7 @@ if __name__ == '__main__':
args = parser.parse_args()
builder = LicenseBuilder(args.buildfile_dirs, args.target_name)
sys.exit(builder.GenerateLicenseText(args.output_dir))
+
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « tools-webrtc/gtest-parallel-wrapper.py ('k') | tools-webrtc/vim/webrtc.ycm_extra_conf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698