| 32 | } |
| 33 | |
| 34 | def get_paths(self, metadata: Optional[dict]=None, package=None) -> Generator[ScanLocation, None, None]: |
| 35 | if package is None: |
| 36 | package = self.package |
| 37 | |
| 38 | if self.opts["release"] == "latest": |
| 39 | release = package.get_latest_release() |
| 40 | else: |
| 41 | release = self.opts["release"] |
| 42 | |
| 43 | for x in self.package["releases"][release]: |
| 44 | if metadata: |
| 45 | meta = metadata.copy() |
| 46 | else: |
| 47 | meta = {"depth": 0, "report_imports": True, "package_instance": self.package} |
| 48 | |
| 49 | meta.update(self.metadata) |
| 50 | meta.setdefault("package", {})["info"] = x |
| 51 | pkg_path = self.mirror_path / urlparse(x["url"]).path.lstrip("/") |
| 52 | target = cache.MirrorFile.proxy(src=pkg_path) |
| 53 | |
| 54 | if target: |
| 55 | yield ScanLocation( |
| 56 | location=target, |
| 57 | metadata=meta |
| 58 | ) |