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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 else: 225 else:
226 continue 226 continue
227 # FIXME: This block should really be a separate function, but th e early-continues make that difficult. 227 # FIXME: This block should really be a separate function, but th e early-continues make that difficult.
228 228
229 if filename.startswith('.') or filename.endswith('.pl'): 229 if filename.startswith('.') or filename.endswith('.pl'):
230 continue # For some reason the w3c repo contains random per l scripts we don't care about. 230 continue # For some reason the w3c repo contains random per l scripts we don't care about.
231 231
232 fullpath = self.filesystem.join(root, filename) 232 fullpath = self.filesystem.join(root, filename)
233 233
234 mimetype = mimetypes.guess_type(fullpath) 234 mimetype = mimetypes.guess_type(fullpath)
235 if not 'html' in str(mimetype[0]) and not 'application/xhtml+xml ' in str(mimetype[0]) and not 'application/xml' in str(mimetype[0]): 235 if ('html' not in str(mimetype[0]) and
236 'application/xhtml+xml' not in str(mimetype[0]) and
237 'application/xml' not in str(mimetype[0])):
236 copy_list.append({'src': fullpath, 'dest': filename}) 238 copy_list.append({'src': fullpath, 'dest': filename})
237 continue 239 continue
238 240
239 if self.filesystem.basename(root) in DIRS_TO_INCLUDE: 241 if self.filesystem.basename(root) in DIRS_TO_INCLUDE:
240 copy_list.append({'src': fullpath, 'dest': filename}) 242 copy_list.append({'src': fullpath, 'dest': filename})
241 continue 243 continue
242 244
243 test_parser = TestParser(vars(self.options), filename=fullpath) 245 test_parser = TestParser(vars(self.options), filename=fullpath)
244 test_info = test_parser.analyze_test() 246 test_info = test_parser.analyze_test()
245 if test_info is None: 247 if test_info is None:
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 """ Creates a destination directory that mirrors that of the source dire ctory """ 420 """ Creates a destination directory that mirrors that of the source dire ctory """
419 421
420 new_subpath = self.dir_to_import[len(self.top_of_repo):] 422 new_subpath = self.dir_to_import[len(self.top_of_repo):]
421 423
422 destination_directory = self.filesystem.join(self.destination_directory, new_subpath) 424 destination_directory = self.filesystem.join(self.destination_directory, new_subpath)
423 425
424 if not self.filesystem.exists(destination_directory): 426 if not self.filesystem.exists(destination_directory):
425 self.filesystem.maybe_make_directory(destination_directory) 427 self.filesystem.maybe_make_directory(destination_directory)
426 428
427 _log.info('Tests will be imported into: %s', destination_directory) 429 _log.info('Tests will be imported into: %s', destination_directory)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698