Commit 9d33de0d by rfkelly0

WrapFS: remove support for listdir(info=True)

parent ca1c1737
...@@ -155,24 +155,16 @@ class WrapFS(FS): ...@@ -155,24 +155,16 @@ 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 = basename(self._decode(pathjoin(enc_path,e)))
e = e.copy() if not wildcard(e):
fullnm = pathjoin(enc_path,e["name"]) continue
e["name"] = basename(self._decode(fullnm)) if full:
if not wildcard(e["name"]): e = pathjoin(path,e)
continue elif absolute:
else: e = abspath(pathjoin(path,e))
e = basename(self._decode(pathjoin(enc_path,e)))
if not wildcard(e):
continue
if full:
e = pathjoin(path,e)
elif absolute:
e = abspath(pathjoin(path,e))
entries.append(e) entries.append(e)
return entries return entries
......
...@@ -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