Matches any string that matches the specified path. Uses os.path.normcase() to normalize both strings before comparison.
| 152 | |
| 153 | |
| 154 | class 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 | |
| 191 | class ListContaining(Some): |
no outgoing calls
searching dependent graphs…