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

Unified Diff: tools/telemetry/telemetry/page_filter.py

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 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/page_benchmark_value.py ('k') | tools/telemetry/telemetry/page_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page_filter.py
diff --git a/tools/telemetry/telemetry/page_filter.py b/tools/telemetry/telemetry/page_filter.py
deleted file mode 100644
index dcf30b864e68a565f49e05cb6621cb2a13e13c6e..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/page_filter.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-import optparse
-import re
-
-class PageFilter(object):
- """Filters pages in the page set based on command line flags."""
-
- def __init__(self, options):
- if options.page_filter:
- try:
- self._page_regex = re.compile(options.page_filter)
- except re.error:
- raise Exception('--page-filter: invalid regex')
- else:
- self._page_regex = None
-
- if options.page_filter_exclude:
- try:
- self._page_exclude_regex = re.compile(options.page_filter_exclude)
- except re.error:
- raise Exception('--page-filter-exclude: invalid regex')
- else:
- self._page_exclude_regex = None
-
- def IsSelected(self, page):
- if self._page_exclude_regex and self._page_exclude_regex.search(page.url):
- return False
- if self._page_regex:
- return self._page_regex.search(page.url)
- return True
-
- @staticmethod
- def AddCommandLineOptions(parser):
- group = optparse.OptionGroup(parser, 'Page filtering options')
- group.add_option('--page-filter', dest='page_filter',
- help='Use only pages whose URLs match the given filter regexp.')
- group.add_option('--page-filter-exclude', dest='page_filter_exclude',
- help='Exclude pages whose URLs match the given filter regexp.')
- parser.add_option_group(group)
« no previous file with comments | « tools/telemetry/telemetry/page_benchmark_value.py ('k') | tools/telemetry/telemetry/page_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698