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

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

Issue 686623002: [Telemetry] Add labels attribute to page as the new way to set label (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/__init__.py ('k') | tools/telemetry/telemetry/page/page_filter_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/page_filter.py
diff --git a/tools/telemetry/telemetry/page/page_filter.py b/tools/telemetry/telemetry/page/page_filter.py
index ea009b5424911165a87d7029c0ce5a16dbb923cc..20bf9052d01f3c2a3e67a0d1657d1c4a18ed62cd 100644
--- a/tools/telemetry/telemetry/page/page_filter.py
+++ b/tools/telemetry/telemetry/page/page_filter.py
@@ -8,11 +8,8 @@ import re
from telemetry.core import command_line
-def HasLabelIn(obj, labels):
- for label in labels:
- if hasattr(obj, label) and getattr(obj, label):
- return True
- return False
+def HasLabelIn(page, labels):
+ return bool(page.labels.intersection(labels))
class PageFilter(command_line.ArgumentHandlerMixIn):
« no previous file with comments | « tools/telemetry/telemetry/page/__init__.py ('k') | tools/telemetry/telemetry/page/page_filter_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698