Searches for ``path`` and returns full path if found. If path is a URL, _findfile will cache a local copy and return the path to the cached file. If path is a local file, _findfile will return a path to that local file. The search will include possible compressed v
(self, path)
| 338 | return upath |
| 339 | |
| 340 | def _findfile(self, path): |
| 341 | """Searches for ``path`` and returns full path if found. |
| 342 | |
| 343 | If path is a URL, _findfile will cache a local copy and return the |
| 344 | path to the cached file. If path is a local file, _findfile will |
| 345 | return a path to that local file. |
| 346 | |
| 347 | The search will include possible compressed versions of the file |
| 348 | and return the first occurrence found. |
| 349 | |
| 350 | """ |
| 351 | |
| 352 | # Build list of possible local file paths |
| 353 | if not self._isurl(path): |
| 354 | # Valid local paths |
| 355 | filelist = self._possible_names(path) |
| 356 | # Paths in self._destpath |
| 357 | filelist += self._possible_names(self.abspath(path)) |
| 358 | else: |
| 359 | # Cached URLs in self._destpath |
| 360 | filelist = self._possible_names(self.abspath(path)) |
| 361 | # Remote URLs |
| 362 | filelist = filelist + self._possible_names(path) |
| 363 | |
| 364 | for name in filelist: |
| 365 | if self.exists(name): |
| 366 | if self._isurl(name): |
| 367 | name = self._cache(name) |
| 368 | return name |
| 369 | return None |
| 370 | |
| 371 | def abspath(self, path): |
| 372 | """ |