| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Utility for checking and processing licensing information in third_party | 6 """Utility for checking and processing licensing information in third_party |
| 7 directories. | 7 directories. |
| 8 | 8 |
| 9 Usage: licenses.py <command> | 9 Usage: licenses.py <command> |
| 10 | 10 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 # Directories we don't scan through. | 88 # Directories we don't scan through. |
| 89 PRUNE_DIRS = ('.svn', '.git', # VCS metadata | 89 PRUNE_DIRS = ('.svn', '.git', # VCS metadata |
| 90 'out', 'Debug', 'Release', # build files | 90 'out', 'Debug', 'Release', # build files |
| 91 'layout_tests') # lots of subdirs | 91 'layout_tests') # lots of subdirs |
| 92 | 92 |
| 93 ADDITIONAL_PATHS = ( | 93 ADDITIONAL_PATHS = ( |
| 94 # The directory with the word list for Chinese and Japanese segmentation | 94 # The directory with the word list for Chinese and Japanese segmentation |
| 95 # with different license terms than ICU. | 95 # with different license terms than ICU. |
| 96 os.path.join('third_party','icu','source','data','brkitr'), | 96 os.path.join('third_party','icu','source','data','brkitr'), |
| 97 # Fake directory so we can include the strongtalk license. |
| 98 os.path.join('v8', 'strongtalk'), |
| 97 ) | 99 ) |
| 98 | 100 |
| 99 | 101 |
| 100 # Directories where we check out directly from upstream, and therefore | 102 # Directories where we check out directly from upstream, and therefore |
| 101 # can't provide a README.chromium. Please prefer a README.chromium | 103 # can't provide a README.chromium. Please prefer a README.chromium |
| 102 # wherever possible. | 104 # wherever possible. |
| 103 SPECIAL_CASES = { | 105 SPECIAL_CASES = { |
| 104 os.path.join('third_party', 'angle'): { | 106 os.path.join('third_party', 'angle'): { |
| 105 "Name": "Almost Native Graphics Layer Engine", | 107 "Name": "Almost Native Graphics Layer Engine", |
| 106 "URL": "http://code.google.com/p/angleproject/", | 108 "URL": "http://code.google.com/p/angleproject/", |
| (...skipping 23 matching lines...) Expand all Loading... |
| 130 os.path.join('third_party', 'GTM'): { | 132 os.path.join('third_party', 'GTM'): { |
| 131 "Name": "Google Toolbox for Mac", | 133 "Name": "Google Toolbox for Mac", |
| 132 "URL": "http://code.google.com/p/google-toolbox-for-mac/", | 134 "URL": "http://code.google.com/p/google-toolbox-for-mac/", |
| 133 "License File": "COPYING", | 135 "License File": "COPYING", |
| 134 }, | 136 }, |
| 135 os.path.join('third_party', 'pdfsqueeze'): { | 137 os.path.join('third_party', 'pdfsqueeze'): { |
| 136 "Name": "pdfsqueeze", | 138 "Name": "pdfsqueeze", |
| 137 "URL": "http://code.google.com/p/pdfsqueeze/", | 139 "URL": "http://code.google.com/p/pdfsqueeze/", |
| 138 "License File": "COPYING", | 140 "License File": "COPYING", |
| 139 }, | 141 }, |
| 142 os.path.join('v8', 'strongtalk'): { |
| 143 "Name": "Strongtalk", |
| 144 "URL": "http://www.strongtalk.org/", |
| 145 "License File": "/v8/LICENSE.strongtalk", |
| 146 }, |
| 140 } | 147 } |
| 141 | 148 |
| 142 class LicenseError(Exception): | 149 class LicenseError(Exception): |
| 143 """We raise this exception when a directory's licensing info isn't | 150 """We raise this exception when a directory's licensing info isn't |
| 144 fully filled out.""" | 151 fully filled out.""" |
| 145 pass | 152 pass |
| 146 | 153 |
| 147 | 154 |
| 148 def ParseDir(path): | 155 def ParseDir(path): |
| 149 """Examine a third_party/foo component and extract its metadata.""" | 156 """Examine a third_party/foo component and extract its metadata.""" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 elif command == 'credits': | 311 elif command == 'credits': |
| 305 if not GenerateCredits(): | 312 if not GenerateCredits(): |
| 306 return 1 | 313 return 1 |
| 307 else: | 314 else: |
| 308 print __doc__ | 315 print __doc__ |
| 309 return 1 | 316 return 1 |
| 310 | 317 |
| 311 | 318 |
| 312 if __name__ == '__main__': | 319 if __name__ == '__main__': |
| 313 sys.exit(main()) | 320 sys.exit(main()) |
| OLD | NEW |