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

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

Issue 2329263002: Run format-webkitpy and fix long lines. (Closed)
Patch Set: 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 class PrintExpectations(Command): 58 class PrintExpectations(Command):
59 name = 'print-expectations' 59 name = 'print-expectations'
60 help_text = 'Print the expected result for the given test(s) on the given po rt(s)' 60 help_text = 'Print the expected result for the given test(s) on the given po rt(s)'
61 show_in_main_help = True 61 show_in_main_help = True
62 62
63 def __init__(self): 63 def __init__(self):
64 options = [ 64 options = [
65 make_option('--all', action='store_true', default=False, 65 make_option('--all', action='store_true', default=False,
66 help='display the expectations for *all* tests'), 66 help='display the expectations for *all* tests'),
67 make_option('-x', '--exclude-keyword', action='append', default=[], 67 make_option('-x', '--exclude-keyword', action='append', default=[],
68 help='limit to tests not matching the given keyword (for example, "skip", "slow", or "crash". May specify multiple times'), 68 help='limit to tests not matching the given keyword (for example, '
69 '"skip", "slow", or "crash". May specify multiple t imes'),
69 make_option('-i', '--include-keyword', action='append', default=[], 70 make_option('-i', '--include-keyword', action='append', default=[],
70 help='limit to tests with the given keyword (for example , "skip", "slow", or "crash". May specify multiple times'), 71 help='limit to tests with the given keyword (for example , "skip", '
72 '"slow", or "crash". May specify multiple times'),
71 make_option('--csv', action='store_true', default=False, 73 make_option('--csv', action='store_true', default=False,
72 help='Print a CSV-style report that includes the port na me, bugs, specifiers, tests, and expectations'), 74 help='Print a CSV-style report that includes the port na me, bugs, '
75 'specifiers, tests, and expectations'),
73 make_option('-f', '--full', action='store_true', default=False, 76 make_option('-f', '--full', action='store_true', default=False,
74 help='Print a full TestExpectations-style line for every match'), 77 help='Print a full TestExpectations-style line for every match'),
75 make_option('--paths', action='store_true', default=False, 78 make_option('--paths', action='store_true', default=False,
76 help='display the paths for all applicable expectation f iles'), 79 help='display the paths for all applicable expectation f iles'),
77 ] + platform_options(use_globs=True) 80 ] + platform_options(use_globs=True)
78 81
79 super(PrintExpectations, self).__init__(options=options) 82 super(PrintExpectations, self).__init__(options=options)
80 self._expectation_models = {} 83 self._expectation_models = {}
81 84
82 def execute(self, options, args, tool): 85 def execute(self, options, args, tool):
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 class PrintBaselines(Command): 150 class PrintBaselines(Command):
148 name = 'print-baselines' 151 name = 'print-baselines'
149 help_text = 'Prints the baseline locations for given test(s) on the given po rt(s)' 152 help_text = 'Prints the baseline locations for given test(s) on the given po rt(s)'
150 show_in_main_help = True 153 show_in_main_help = True
151 154
152 def __init__(self): 155 def __init__(self):
153 options = [ 156 options = [
154 make_option('--all', action='store_true', default=False, 157 make_option('--all', action='store_true', default=False,
155 help='display the baselines for *all* tests'), 158 help='display the baselines for *all* tests'),
156 make_option('--csv', action='store_true', default=False, 159 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'), 160 help='Print a CSV-style report that includes the port na me, test_name, '
161 'test platform, baseline type, baseline location, a nd baseline platform'),
158 make_option('--include-virtual-tests', action='store_true', 162 make_option('--include-virtual-tests', action='store_true',
159 help='Include virtual tests'), 163 help='Include virtual tests'),
160 ] + platform_options(use_globs=True) 164 ] + platform_options(use_globs=True)
161 super(PrintBaselines, self).__init__(options=options) 165 super(PrintBaselines, self).__init__(options=options)
162 self._platform_regexp = re.compile(r'platform/([^\/]+)/(.+)') 166 self._platform_regexp = re.compile(r'platform/([^\/]+)/(.+)')
163 167
164 def execute(self, options, args, tool): 168 def execute(self, options, args, tool):
165 if not args and not options.all: 169 if not args and not options.all:
166 print "You must either specify one or more test paths or --all." 170 print "You must either specify one or more test paths or --all."
167 return 171 return
(...skipping 28 matching lines...) Expand all
196 print "%s,%s,%s,%s,%s,%s" % (port_name, test_name, self._pla tform_for_path(test_name), 200 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)) 201 extension[1:], baseline_locatio n, self._platform_for_path(baseline_location))
198 else: 202 else:
199 print baseline_location 203 print baseline_location
200 204
201 def _platform_for_path(self, relpath): 205 def _platform_for_path(self, relpath):
202 platform_matchobj = self._platform_regexp.match(relpath) 206 platform_matchobj = self._platform_regexp.match(relpath)
203 if platform_matchobj: 207 if platform_matchobj:
204 return platform_matchobj.group(1) 208 return platform_matchobj.group(1)
205 return None 209 return None
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698