Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
| 5 # are met: | 5 # are met: |
| 6 # | 6 # |
| 7 # 1. Redistributions of source code must retain the above | 7 # 1. Redistributions of source code must retain the above |
| 8 # copyright notice, this list of conditions and the following | 8 # copyright notice, this list of conditions and the following |
| 9 # disclaimer. | 9 # disclaimer. |
| 10 # 2. Redistributions in binary form must reproduce the above | 10 # 2. Redistributions in binary form must reproduce the above |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 path_base = self.destination_directory.replace(self.layout_tests _dir + '/', '') + '/' + path_base | 132 path_base = self.destination_directory.replace(self.layout_tests _dir + '/', '') + '/' + path_base |
| 133 if path_base in paths_to_skip: | 133 if path_base in paths_to_skip: |
| 134 if self.import_in_place: | 134 if self.import_in_place: |
| 135 _log.debug('Pruning: %s', path_base) | 135 _log.debug('Pruning: %s', path_base) |
| 136 self.filesystem.remove(path_full) | 136 self.filesystem.remove(path_full) |
| 137 continue | 137 continue |
| 138 else: | 138 else: |
| 139 continue | 139 continue |
| 140 # FIXME: This block should really be a separate function, but th e early-continues make that difficult. | 140 # FIXME: This block should really be a separate function, but th e early-continues make that difficult. |
| 141 | 141 |
| 142 if filename.startswith('.') or filename.endswith('.pl'): | 142 # TODO(qyearsley): Remove the below block. |
| 143 if filename.startswith('.gitkeep') or filename.endswith('.pl'): | |
|
jeffcarp
2017/03/07 01:17:11
As we talked about in person, I think it would be
| |
| 143 _log.debug('Skipping: %s', path_full) | 144 _log.debug('Skipping: %s', path_full) |
| 144 _log.debug(' Reason: Hidden files and perl scripts are not necessary.') | 145 _log.debug(' Reason: Hidden files and perl scripts are not necessary.') |
| 145 continue | 146 continue |
| 147 | |
| 146 if filename == 'OWNERS' or filename == 'reftest.list': | 148 if filename == 'OWNERS' or filename == 'reftest.list': |
| 147 # See http://crbug.com/584660 and http://crbug.com/582838. | 149 # See http://crbug.com/584660 and http://crbug.com/582838. |
| 148 _log.debug('Skipping: %s', path_full) | 150 _log.debug('Skipping: %s', path_full) |
| 149 _log.debug(' Reason: This file may cause Chromium presubmit to fail.') | 151 _log.debug(' Reason: This file may cause Chromium presubmit to fail.') |
| 150 continue | 152 continue |
| 151 | 153 |
| 152 mimetype = mimetypes.guess_type(path_full) | 154 mimetype = mimetypes.guess_type(path_full) |
| 153 if ('html' not in str(mimetype[0]) and | 155 if ('html' not in str(mimetype[0]) and |
| 154 'application/xhtml+xml' not in str(mimetype[0]) and | 156 'application/xhtml+xml' not in str(mimetype[0]) and |
| 155 'application/xml' not in str(mimetype[0])): | 157 'application/xml' not in str(mimetype[0])): |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 return False | 323 return False |
| 322 | 324 |
| 323 # Conversion is not necessary for any tests in wpt now; see http://crbug .com/654081. | 325 # Conversion is not necessary for any tests in wpt now; see http://crbug .com/654081. |
| 324 # Note, we want to move away from converting files, see http://crbug.com /663773. | 326 # Note, we want to move away from converting files, see http://crbug.com /663773. |
| 325 if re.search(r'[/\\]external[/\\]wpt[/\\]', dest_dir): | 327 if re.search(r'[/\\]external[/\\]wpt[/\\]', dest_dir): |
| 326 return False | 328 return False |
| 327 | 329 |
| 328 # Only HTML, XHTML and CSS files should be converted. | 330 # Only HTML, XHTML and CSS files should be converted. |
| 329 mimetype, _ = mimetypes.guess_type(source_path) | 331 mimetype, _ = mimetypes.guess_type(source_path) |
| 330 return mimetype in ('text/html', 'application/xhtml+xml', 'text/css') | 332 return mimetype in ('text/html', 'application/xhtml+xml', 'text/css') |
| OLD | NEW |