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

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

Issue 1839193004: Run auto-formatter (autopep8) on webkitpy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 8 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 3 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions 6 # modification, are permitted provided that the following conditions
7 # are met: 7 # are met:
8 # 8 #
9 # 1. Redistributions of source code must retain the above 9 # 1. Redistributions of source code must retain the above
10 # copyright notice, this list of conditions and the following 10 # copyright notice, this list of conditions and the following
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if self.ref_doc is None: 100 if self.ref_doc is None:
101 self.load_file(ref_file, True) 101 self.load_file(ref_file, True)
102 102
103 test_info = {'test': self.filename, 'reference': ref_file} 103 test_info = {'test': self.filename, 'reference': ref_file}
104 104
105 # If the ref file does not live in the same directory as the test fi le, check it for support files 105 # If the ref file does not live in the same directory as the test fi le, check it for support files
106 test_info['reference_support_info'] = {} 106 test_info['reference_support_info'] = {}
107 if self.filesystem.dirname(ref_file) != self.filesystem.dirname(self .filename): 107 if self.filesystem.dirname(ref_file) != self.filesystem.dirname(self .filename):
108 reference_support_files = self.support_files(self.ref_doc) 108 reference_support_files = self.support_files(self.ref_doc)
109 if len(reference_support_files) > 0: 109 if len(reference_support_files) > 0:
110 reference_relpath = self.filesystem.relpath(self.filesystem. dirname(self.filename), self.filesystem.dirname(ref_file)) + self.filesystem.sep 110 reference_relpath = self.filesystem.relpath(self.filesystem. dirname(
111 self.filename), self.filesystem.dirname(ref_file)) + sel f.filesystem.sep
111 test_info['reference_support_info'] = {'reference_relpath': reference_relpath, 'files': reference_support_files} 112 test_info['reference_support_info'] = {'reference_relpath': reference_relpath, 'files': reference_support_files}
112 113
113 elif self.is_jstest(): 114 elif self.is_jstest():
114 test_info = {'test': self.filename, 'jstest': True} 115 test_info = {'test': self.filename, 'jstest': True}
115 elif self.options['all'] is True and not('-ref' in self.filename) and no t('reference' in self.filename): 116 elif self.options['all'] is True and not('-ref' in self.filename) and no t('reference' in self.filename):
116 test_info = {'test': self.filename} 117 test_info = {'test': self.filename}
117 118
118 return test_info 119 return test_info
119 120
120 def reference_links_of_type(self, reftest_type): 121 def reference_links_of_type(self, reftest_type):
(...skipping 25 matching lines...) Expand all
146 href_paths = [href_tag['href'] for href_tag in elements_with_href_attrib utes] 147 href_paths = [href_tag['href'] for href_tag in elements_with_href_attrib utes]
147 148
148 paths = src_paths + href_paths + urls 149 paths = src_paths + href_paths + urls
149 for path in paths: 150 for path in paths:
150 if not(path.startswith('http:')) and not(path.startswith('mailto:')) : 151 if not(path.startswith('http:')) and not(path.startswith('mailto:')) :
151 uri_scheme_pattern = re.compile(r"[A-Za-z][A-Za-z+.-]*:") 152 uri_scheme_pattern = re.compile(r"[A-Za-z][A-Za-z+.-]*:")
152 if not uri_scheme_pattern.match(path): 153 if not uri_scheme_pattern.match(path):
153 support_files.append(path) 154 support_files.append(path)
154 155
155 return support_files 156 return support_files
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698