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

Unified Diff: tools/telemetry/telemetry/internal/util/path_set.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: tools/telemetry/telemetry/internal/util/path_set.py
diff --git a/tools/telemetry/telemetry/internal/util/path_set.py b/tools/telemetry/telemetry/internal/util/path_set.py
deleted file mode 100644
index 0b467835b6a63ba0d450088a3cf674c6f91010fb..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/internal/util/path_set.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2014 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 collections
-import os
-
-
-class PathSet(collections.MutableSet):
- """A set of paths.
-
- All mutation methods can take both directories or individual files, but the
- iterator yields the individual files. All paths are automatically normalized.
- """
- def __init__(self, iterable=None):
- self._paths = set()
- if iterable:
- self |= iterable
-
- def __contains__(self, path):
- return os.path.realpath(path) in self._paths
-
- def __iter__(self):
- return iter(self._paths)
-
- def __len__(self):
- return len(self._paths)
-
- def add(self, path):
- path = os.path.realpath(path)
- if os.path.isfile(path):
- self._paths.add(path)
- for root, _, files in os.walk(path):
- for basename in files:
- file_path = os.path.join(root, basename)
- if os.path.isfile(file_path):
- self._paths.add(file_path)
-
- def discard(self, path):
- path = os.path.realpath(path)
- self._paths.discard(path)
- for root, _, files in os.walk(path):
- for basename in files:
- self._paths.discard(os.path.join(root, basename))
« no previous file with comments | « tools/telemetry/telemetry/internal/util/path.py ('k') | tools/telemetry/telemetry/internal/util/path_set_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698