MCPcopy Create free account
hub / github.com/microsoft/debugpy / Path

Class Path

tests/patterns/_impl.py:154–188  ·  view source on GitHub ↗

Matches any string that matches the specified path. Uses os.path.normcase() to normalize both strings before comparison.

Source from the content-addressed store, hash-verified

152
153
154class Path(Some):
155 """Matches any string that matches the specified path.
156
157 Uses os.path.normcase() to normalize both strings before comparison.
158 """
159
160 def __init__(self, path):
161 if isinstance(path, py.path.local):
162 path = path.strpath
163 assert isinstance(path, str)
164 self.path = path
165
166 def __repr__(self):
167 return "path({self.path!r})"
168
169 def __str__(self):
170 return self.path
171
172 def __getstate__(self):
173 return self.path
174
175 def matches(self, other):
176 if isinstance(other, py.path.local):
177 other = other.strpath
178
179 if isinstance(other, str):
180 pass
181 elif isinstance(other, bytes):
182 other = other.encode(sys.getfilesystemencoding())
183 else:
184 return NotImplemented
185
186 left = pydevd_file_utils.get_path_with_real_case(self.path)
187 right = pydevd_file_utils.get_path_with_real_case(other)
188 return left == right
189
190
191class ListContaining(Some):

Callers 5

_load_filtersFunction · 0.85
original_datadirFunction · 0.85
datadirFunction · 0.85
check_text_filesFunction · 0.85
perform_regression_checkFunction · 0.85

Calls

no outgoing calls

Tested by 1

_load_filtersFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…