Commit 09b34494 by rfkelly0

OSFS.watch_inotify: add convert_os_errors wrapper

parent 1c48944a
......@@ -251,7 +251,7 @@ class DAVFS(FS):
if self.closed:
raise RemoteConnectionError("",msg="FS is closed")
resp = con.getresponse()
#logger.debug("DAVFS <RESP %s %s/%s",method,url.hostname,url.path)
#logger.debug("DAVFS <RESP %s %s %s/%s",resp.status,method,url.hostname,url.path)
self._cookiejar.extract_cookies(FakeResp(resp),FakeReq(con,url.scheme,url.path))
except Exception, e:
self._del_connection(con)
......
......@@ -48,6 +48,7 @@ class OSFSWatchMixin(WatchableFSMixin):
finally:
self.__watch_lock.release()
@convert_os_errors
def add_watcher(self,callback,path="/",events=None,recursive=True):
super_add_watcher = super(OSFSWatchMixin,self).add_watcher
w = super_add_watcher(callback,path,events,recursive)
......@@ -79,6 +80,7 @@ class OSFSWatchMixin(WatchableFSMixin):
self.__watch_lock.release()
return w
@convert_os_errors
def del_watcher(self,watcher_or_callback):
if isinstance(watcher_or_callback,Watcher):
watchers = [watcher_or_callback]
......
......@@ -10,7 +10,7 @@ simulate such an ability on top of an ordinary FS object.
An FS object that wants to be "watchable" must provide the following methods:
* add_watcher(path,callback,events=None,recursive=True)
* add_watcher(callback,path="/",events=None,recursive=True)
Request that the given callback be executed in response to changes
to the given path. A specific set of change events can be specified.
......
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