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

Unified Diff: tools/telemetry/telemetry/core/repeat_options.py

Issue 23514038: No need for RepeatOptions.AddCommandLineOptions to be static. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/core/browser_options.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/repeat_options.py
diff --git a/tools/telemetry/telemetry/core/repeat_options.py b/tools/telemetry/telemetry/core/repeat_options.py
index 9836dea2267fb2d4a4dd0c4e416016171239277c..cb0030639b2ea68716d3853b51ee3ddf53deef24 100644
--- a/tools/telemetry/telemetry/core/repeat_options.py
+++ b/tools/telemetry/telemetry/core/repeat_options.py
@@ -18,8 +18,7 @@ class RepeatOptions(object):
return RepeatOptions(self.page_repeat_secs, self.pageset_repeat_secs,
self.page_repeat_iters, self.pageset_repeat_iters)
- @staticmethod
- def AddCommandLineOptions(parser):
+ def AddCommandLineOptions(self, parser):
group = optparse.OptionGroup(parser, 'Repeat options')
group.add_option('--page-repeat', dest='page_repeat', default='1',
help='Number of iterations or length of time to repeat '
@@ -35,8 +34,8 @@ class RepeatOptions(object):
'seconds.')
parser.add_option_group(group)
- def _ParseRepeatOption(self, browser_options, input_str, parser):
- match = re.match('([0-9]+)([sS]?)$', str(getattr(browser_options,
+ def _ParseRepeatOption(self, finder_options, input_str, parser):
+ match = re.match('([0-9]+)([sS]?)$', str(getattr(finder_options,
input_str, '')))
if match:
if match.group(2):
@@ -45,15 +44,15 @@ class RepeatOptions(object):
setattr(self, input_str + '_iters', 1)
else:
setattr(self, input_str + '_iters', int(match.group(1)))
- delattr(browser_options, input_str)
+ delattr(finder_options, input_str)
else:
parser.error('Usage: --%s only accepts an int '
'followed by only an \'s\' if using time. '
'e.g. \'10\' or \'10s\'\n' % input_str.replace('_','-'))
- def UpdateFromParseResults(self, browser_options, parser):
- self._ParseRepeatOption(browser_options, 'page_repeat', parser)
- self._ParseRepeatOption(browser_options, 'pageset_repeat', parser)
+ def UpdateFromParseResults(self, finder_options, parser):
+ self._ParseRepeatOption(finder_options, 'page_repeat', parser)
+ self._ParseRepeatOption(finder_options, 'pageset_repeat', parser)
def IsRepeating(self):
"""Returns True if we will be repeating pages or pagesets."""
« no previous file with comments | « tools/telemetry/telemetry/core/browser_options.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698