Commit 814dcd50 by rfkelly0

CacheFS: add cache handling for listdirinfo method

parent 1024ec16
...@@ -15,7 +15,7 @@ implementations of this interface such as: ...@@ -15,7 +15,7 @@ implementations of this interface such as:
""" """
__version__ = "0.4.0a1" __version__ = "0.4.0a2"
__author__ = "Will McGugan (will@willmcgugan.com)" __author__ = "Will McGugan (will@willmcgugan.com)"
# 'base' imports * from 'path' and 'errors', so their # 'base' imports * from 'path' and 'errors', so their
......
...@@ -403,6 +403,7 @@ class CacheFS(WrapFS): ...@@ -403,6 +403,7 @@ class CacheFS(WrapFS):
cache[""].pop("getinfo",None) cache[""].pop("getinfo",None)
cache[""].pop("getsize",None) cache[""].pop("getsize",None)
cache[""].pop("listdir",None) cache[""].pop("listdir",None)
cache[""].pop("listdirinfo",None)
# Clear all cached info for the path itself. # Clear all cached info for the path itself.
cache[names[-1]] = {"":{}} cache[names[-1]] = {"":{}}
...@@ -423,6 +424,10 @@ class CacheFS(WrapFS): ...@@ -423,6 +424,10 @@ class CacheFS(WrapFS):
return super(CacheFS,self).listdir(path,**kwds) return super(CacheFS,self).listdir(path,**kwds)
@_cached_method @_cached_method
def listdirinfo(self,path="",**kwds):
return super(CacheFS,self).listdirinfo(path,**kwds)
@_cached_method
def getinfo(self,path): def getinfo(self,path):
return super(CacheFS,self).getinfo(path) return super(CacheFS,self).getinfo(path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment