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

Unified Diff: android_webview/tools/webview_licenses.py

Issue 10829355: Make checking the existence of the license file optional in the license tool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused print_warnings Created 8 years, 4 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 | tools/licenses.py » ('j') | tools/licenses.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/tools/webview_licenses.py
diff --git a/android_webview/tools/webview_licenses.py b/android_webview/tools/webview_licenses.py
index 338a4267e70cc230e9b8c6d6a9505ed6b66a9869..b43289553b392def918d5ff7418d3f2268201246 100755
--- a/android_webview/tools/webview_licenses.py
+++ b/android_webview/tools/webview_licenses.py
@@ -53,7 +53,7 @@ def GetIncompatibleDirectories():
regex = '^(%s)$' % '|'.join(whitelist)
result = []
for directory in _FindThirdPartyDirs():
- metadata = licenses.ParseDir(directory)
+ metadata = licenses.ParseDir(directory, require_license_file=False)
if metadata.get('License Android Compatible', 'no') == 'yes':
continue
license = re.split(' [Ll]icenses?$', metadata['License'])[0]
@@ -193,10 +193,9 @@ def _Scan():
and all_licenses_valid
-def _GenerateNoticeFile(print_warnings):
+def GenerateNoticeFile():
"""Generates the contents of an Android NOTICE file for the third-party code.
- Args:
- print_warnings: Whether to print warnings.
+ This is used by the snapshot tool.
Returns:
The contents of the NOTICE file.
"""
@@ -209,8 +208,9 @@ def _GenerateNoticeFile(print_warnings):
# We provide attribution for all third-party directories.
# TODO(steveblock): Limit this to only code used by the WebView binary.
for directory in third_party_dirs:
- license_file = licenses.ParseDir(directory)['License File']
- if license_file != licenses.NOT_SHIPPED:
+ metadata = licenses.ParseDir(directory, require_license_file=False)
+ license_file = metadata['License File']
+ if license_file and license_file != licenses.NOT_SHIPPED:
content.append(_ReadFile(license_file))
return '\n'.join(content)
@@ -245,7 +245,7 @@ def main():
else:
return 1
elif args[0] == 'notice':
- print _GenerateNoticeFile(print_warnings=False)
+ print GenerateNoticeFile()
return 0
parser.print_help()
« no previous file with comments | « no previous file | tools/licenses.py » ('j') | tools/licenses.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698