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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 if not self.import_in_place and not self.options.dry_run
: | 374 if not self.import_in_place and not self.options.dry_run
: |
375 shutil.copyfile(orig_filepath, new_filepath) # The
file was unmodified. | 375 shutil.copyfile(orig_filepath, new_filepath) # The
file was unmodified. |
376 else: | 376 else: |
377 for prefixed_property in converted_file[0]: | 377 for prefixed_property in converted_file[0]: |
378 total_prefixed_properties.setdefault(prefixed_proper
ty, 0) | 378 total_prefixed_properties.setdefault(prefixed_proper
ty, 0) |
379 total_prefixed_properties[prefixed_property] += 1 | 379 total_prefixed_properties[prefixed_property] += 1 |
380 | 380 |
381 prefixed_properties.extend(set(converted_file[0]) - set(
prefixed_properties)) | 381 prefixed_properties.extend(set(converted_file[0]) - set(
prefixed_properties)) |
382 if not self.options.dry_run: | 382 if not self.options.dry_run: |
383 outfile = open(new_filepath, 'wb') | 383 outfile = open(new_filepath, 'wb') |
384 outfile.write(converted_file[1]) | 384 outfile.write(converted_file[1].encode('utf-8')) |
385 outfile.close() | 385 outfile.close() |
386 else: | 386 else: |
387 if not self.import_in_place and not self.options.dry_run: | 387 if not self.import_in_place and not self.options.dry_run: |
388 shutil.copyfile(orig_filepath, new_filepath) | 388 shutil.copyfile(orig_filepath, new_filepath) |
389 | 389 |
390 copied_files.append(new_filepath.replace(self._webkit_root, '')) | 390 copied_files.append(new_filepath.replace(self._webkit_root, '')) |
391 | 391 |
392 _log.info('') | 392 _log.info('') |
393 _log.info('Import complete') | 393 _log.info('Import complete') |
394 _log.info('') | 394 _log.info('') |
(...skipping 12 matching lines...) Expand all Loading... |
407 """ Creates a destination directory that mirrors that of the source dire
ctory """ | 407 """ Creates a destination directory that mirrors that of the source dire
ctory """ |
408 | 408 |
409 new_subpath = self.dir_to_import[len(self.top_of_repo):] | 409 new_subpath = self.dir_to_import[len(self.top_of_repo):] |
410 | 410 |
411 destination_directory = os.path.join(self.destination_directory, new_sub
path) | 411 destination_directory = os.path.join(self.destination_directory, new_sub
path) |
412 | 412 |
413 if not os.path.exists(destination_directory): | 413 if not os.path.exists(destination_directory): |
414 os.makedirs(destination_directory) | 414 os.makedirs(destination_directory) |
415 | 415 |
416 _log.info('Tests will be imported into: %s', destination_directory) | 416 _log.info('Tests will be imported into: %s', destination_directory) |
OLD | NEW |