Chromium Code Reviews| Index: android_webview/tools/webview_licenses.py |
| diff --git a/android_webview/tools/webview_licenses.py b/android_webview/tools/webview_licenses.py |
| index d2775e7fc5d4357a670d40a9ddd300ff2506c34f..faff7db2402340f6bc4e16d093ec80466b636bc0 100755 |
| --- a/android_webview/tools/webview_licenses.py |
| +++ b/android_webview/tools/webview_licenses.py |
| @@ -297,6 +297,13 @@ def GenerateNoticeFile(): |
| return '\n'.join(content) |
| +def _process_incompatible_result(incompatible_directories): |
|
mkosiba (inactive)
2014/06/11 09:38:38
I think this should be _CamelCase
|
| + if incompatible_directories: |
| + print ("Incompatibly licensed directories found:\n" + |
| + "\n".join(sorted(incompatible_directories))) |
| + return ScanResult.Errors |
| + return ScanResult.Ok |
| + |
| def main(): |
| class FormatterWithNewLines(optparse.IndentedHelpFormatter): |
| def format_description(self, description): |
| @@ -308,10 +315,13 @@ def main(): |
| usage='%prog [options]') |
| parser.description = (__doc__ + |
| '\nCommands:\n' \ |
| - ' scan Check licenses.\n' \ |
| - ' notice Generate Android NOTICE file on stdout. \n' \ |
| + ' scan Check licenses.\n' \ |
| + ' notice Generate Android NOTICE file on stdout.\n' \ |
| ' incompatible_directories Scan for incompatibly' |
| - ' licensed directories.') |
| + ' licensed directories.\n' |
| + ' all_incompatible_directories Scan for incompatibly' |
| + ' licensed directories (even those in' |
| + ' known_issues.py).\n') |
| (_, args) = parser.parse_args() |
| if len(args) != 1: |
| parser.print_help() |
| @@ -326,13 +336,9 @@ def main(): |
| print GenerateNoticeFile() |
| return ScanResult.Ok |
| elif args[0] == 'incompatible_directories': |
| - incompatible_directories = GetUnknownIncompatibleDirectories() |
| - if incompatible_directories: |
| - print ("Incompatibly licensed directories found:\n" + |
| - "\n".join(sorted(incompatible_directories))) |
| - return ScanResult.Errors |
| - return ScanResult.Ok |
| - |
| + return _process_incompatible_result(GetUnknownIncompatibleDirectories()) |
| + elif args[0] == 'all_incompatible_directories': |
| + return _process_incompatible_result(GetIncompatibleDirectories()) |
| parser.print_help() |
| return ScanResult.Errors |