Cache delete items

I can now delete things from the cache in addition to adding things.
This commit is contained in:
Bryan Schumaker 2010-11-28 00:29:36 -05:00
parent fed3c7f356
commit 70a2759192
1 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,11 @@ class CacheObject:
else:
return path
def delete(self, key):
path = join(self.path, key)
if exists(path):
rm(path)
class Cache:
def keys(self):
return ls(CACHE_DIR)