Commit fdeae943 by rfkelly0

adjust other classes now that FS has a base "close" method

parent 3b622389
...@@ -15,7 +15,7 @@ implementations of this interface such as: ...@@ -15,7 +15,7 @@ implementations of this interface such as:
""" """
__version__ = "0.2.0a4" __version__ = "0.2.0a5"
__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
......
...@@ -488,10 +488,9 @@ class MountProcess(subprocess.Popen): ...@@ -488,10 +488,9 @@ class MountProcess(subprocess.Popen):
"""Perform the specified mount, return without waiting.""" """Perform the specified mount, return without waiting."""
(fs,path,opts) = pickle.loads(data) (fs,path,opts) = pickle.loads(data)
opts["foreground"] = True opts["foreground"] = True
if hasattr(fs,"close"): def unmount_callback():
def unmount_callback(): fs.close()
fs.close() opts["unmount_callback"] = unmount_callback
opts["unmount_callback"] = unmount_callback
mount(fs,path,*opts) mount(fs,path,*opts)
@staticmethod @staticmethod
...@@ -506,10 +505,9 @@ class MountProcess(subprocess.Popen): ...@@ -506,10 +505,9 @@ class MountProcess(subprocess.Popen):
os.write(w,"S") os.write(w,"S")
os.close(w) os.close(w)
opts["ready_callback"] = ready_callback opts["ready_callback"] = ready_callback
if hasattr(fs,"close"): def unmount_callback():
def unmount_callback(): fs.close()
fs.close() opts["unmount_callback"] = unmount_callback
opts["unmount_callback"] = unmount_callback
try: try:
mount(fs,path,**opts) mount(fs,path,**opts)
except Exception: except Exception:
......
...@@ -49,8 +49,6 @@ class TempFS(OSFS): ...@@ -49,8 +49,6 @@ class TempFS(OSFS):
self._cleaned = True self._cleaned = True
finally: finally:
self._lock.release() self._lock.release()
super(TempFS,self).close()
def __del__(self):
self.close()
...@@ -233,8 +233,7 @@ class WrapFS(FS): ...@@ -233,8 +233,7 @@ class WrapFS(FS):
@rewrite_errors @rewrite_errors
def close(self): def close(self):
if hasattr(self.wrapped_fs,"close"): self.wrapped_fs.close()
self.wrapped_fs.close()
def wrap_fs_methods(decorator,cls=None,exclude=[]): def wrap_fs_methods(decorator,cls=None,exclude=[]):
"""Apply the given decorator to all FS methods on the given class. """Apply the given decorator to all FS methods on the given class.
......
...@@ -116,9 +116,6 @@ class ZipFS(FS): ...@@ -116,9 +116,6 @@ class ZipFS(FS):
self.zf.close() self.zf.close()
self.zf = _ExceptionProxy() self.zf = _ExceptionProxy()
def __del__(self):
self.close()
@synchronize @synchronize
def open(self, path, mode="r", **kwargs): def open(self, path, mode="r", **kwargs):
path = normpath(path) path = normpath(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