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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries.py

Issue 2305143003: webkitpy: Make all regex strings use raw string literals. (Closed)
Patch Set: Make all regex strings raw strings. Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2009 Google Inc. All rights reserved. 1 # Copyright (c) 2009 Google Inc. All rights reserved.
2 # Copyright (c) 2009 Apple Inc. All rights reserved. 2 # Copyright (c) 2009 Apple Inc. All rights reserved.
3 # Copyright (c) 2012 Intel Corporation. All rights reserved. 3 # Copyright (c) 2012 Intel Corporation. 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 are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 def __init__(self): 152 def __init__(self):
153 options = [ 153 options = [
154 make_option('--all', action='store_true', default=False, 154 make_option('--all', action='store_true', default=False,
155 help='display the baselines for *all* tests'), 155 help='display the baselines for *all* tests'),
156 make_option('--csv', action='store_true', default=False, 156 make_option('--csv', action='store_true', default=False,
157 help='Print a CSV-style report that includes the port na me, test_name, test platform, baseline type, baseline location, and baseline pla tform'), 157 help='Print a CSV-style report that includes the port na me, test_name, test platform, baseline type, baseline location, and baseline pla tform'),
158 make_option('--include-virtual-tests', action='store_true', 158 make_option('--include-virtual-tests', action='store_true',
159 help='Include virtual tests'), 159 help='Include virtual tests'),
160 ] + platform_options(use_globs=True) 160 ] + platform_options(use_globs=True)
161 super(PrintBaselines, self).__init__(options=options) 161 super(PrintBaselines, self).__init__(options=options)
162 self._platform_regexp = re.compile('platform/([^\/]+)/(.+)') 162 self._platform_regexp = re.compile(r'platform/([^\/]+)/(.+)')
163 163
164 def execute(self, options, args, tool): 164 def execute(self, options, args, tool):
165 if not args and not options.all: 165 if not args and not options.all:
166 print "You must either specify one or more test paths or --all." 166 print "You must either specify one or more test paths or --all."
167 return 167 return
168 168
169 default_port = tool.port_factory.get() 169 default_port = tool.port_factory.get()
170 if options.platform: 170 if options.platform:
171 port_names = fnmatch.filter(tool.port_factory.all_port_names(), opti ons.platform) 171 port_names = fnmatch.filter(tool.port_factory.all_port_names(), opti ons.platform)
172 if not port_names: 172 if not port_names:
(...skipping 23 matching lines...) Expand all
196 print "%s,%s,%s,%s,%s,%s" % (port_name, test_name, self._pla tform_for_path(test_name), 196 print "%s,%s,%s,%s,%s,%s" % (port_name, test_name, self._pla tform_for_path(test_name),
197 extension[1:], baseline_locatio n, self._platform_for_path(baseline_location)) 197 extension[1:], baseline_locatio n, self._platform_for_path(baseline_location))
198 else: 198 else:
199 print baseline_location 199 print baseline_location
200 200
201 def _platform_for_path(self, relpath): 201 def _platform_for_path(self, relpath):
202 platform_matchobj = self._platform_regexp.match(relpath) 202 platform_matchobj = self._platform_regexp.match(relpath)
203 if platform_matchobj: 203 if platform_matchobj:
204 return platform_matchobj.group(1) 204 return platform_matchobj.group(1)
205 return None 205 return None
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698