(self, key: str, type: CacheType, filetype=None)
| 103 | self.base_path = Path("./__cache__") |
| 104 | |
| 105 | def path(self, key: str, type: CacheType, filetype=None) -> Path: |
| 106 | if filetype: |
| 107 | key = f"{key}.{filetype}" |
| 108 | p: Path = self.base_path / type.value |
| 109 | if not p.exists(): |
| 110 | p.mkdir() |
| 111 | return p / key |
| 112 | |
| 113 | def is_exists(self, key: str, type: CacheType, filetype=None): |
| 114 | full_path = self.path(key, type, filetype) |