Commit 9d33de0d by rfkelly0

WrapFS: remove support for listdir(info=True)

parent ca1c1737
...@@ -155,17 +155,9 @@ class WrapFS(FS): ...@@ -155,17 +155,9 @@ class WrapFS(FS):
elif not callable(wildcard): elif not callable(wildcard):
wildcard_re = re.compile(fnmatch.translate(wildcard)) wildcard_re = re.compile(fnmatch.translate(wildcard))
wildcard = lambda fn:bool (wildcard_re.match(fn)) wildcard = lambda fn:bool (wildcard_re.match(fn))
info = kwds.get("info",False)
entries = [] entries = []
enc_path = self._encode(path) enc_path = self._encode(path)
for e in self.wrapped_fs.listdir(enc_path,**kwds): for e in self.wrapped_fs.listdir(enc_path,**kwds):
if info:
e = e.copy()
fullnm = pathjoin(enc_path,e["name"])
e["name"] = basename(self._decode(fullnm))
if not wildcard(e["name"]):
continue
else:
e = basename(self._decode(pathjoin(enc_path,e))) e = basename(self._decode(pathjoin(enc_path,e)))
if not wildcard(e): if not wildcard(e):
continue continue
......
...@@ -76,7 +76,7 @@ class LazyFS(WrapFS): ...@@ -76,7 +76,7 @@ class LazyFS(WrapFS):
wrapped_fs = property(_get_wrapped_fs,_set_wrapped_fs) wrapped_fs = property(_get_wrapped_fs,_set_wrapped_fs)
def setcontents(self, path, data): def setcontents(self, path, data):
return self.wrapped_fs.setcontents(path,data) return self.wrapped_fs.setcontents(path, data)
def close(self): def close(self):
if not self.closed: if not self.closed:
......
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