(self, path: str)
| 57 | return f'{path}.cache2' |
| 58 | |
| 59 | def restore(self, path: str) -> Optional[QlPeCacheEntry]: |
| 60 | fcache = QlPeCache.cache_filename(path) |
| 61 | |
| 62 | # check whether cache file exists and it is not older than the cached file itself |
| 63 | if os.path.exists(fcache) and os.stat(fcache).st_mtime > os.stat(path).st_mtime: |
| 64 | with open(fcache, "rb") as fcache_file: |
| 65 | return QlPeCacheEntry(*pickle.load(fcache_file)) |
| 66 | |
| 67 | return None |
| 68 | |
| 69 | def save(self, path: str, entry: QlPeCacheEntry) -> None: |
| 70 | fcache = QlPeCache.cache_filename(path) |
no test coverage detected