| 30 | yield from (cls.get_mirror_path() / "json").iterdir() |
| 31 | |
| 32 | def get_json(self, package_name) -> dict: |
| 33 | assert package_name |
| 34 | json_path = self.get_mirror_path() / "json" / package_name |
| 35 | target = cache.MirrorJSON.proxy(src=json_path) |
| 36 | |
| 37 | if not target.is_file(): |
| 38 | json_path = self.get_mirror_path() / "json" / canonicalize_name(package_name) |
| 39 | target = cache.MirrorJSON.proxy(src=json_path) |
| 40 | if not target.exists(): |
| 41 | raise NoSuchPackage(package_name) |
| 42 | |
| 43 | return json.loads(target.read_text()) |
| 44 | |
| 45 | def url2local(self, url: typing.Union[ParseResult, str]) -> Path: |
| 46 | if not isinstance(url, ParseResult): |