diff options
author | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2010-12-10 23:32:56 +0000 |
---|---|---|
committer | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2010-12-10 23:32:56 +0000 |
commit | a5ffbc28d7cba9d60afb16dd4a6b1344bef90b9c (patch) | |
tree | 22ec7098f30d5eabcaa704e4359834b0623e3746 /fs/remote.py | |
parent | 4dff33202b5957601286af8951b2e7e637dd6772 (diff) | |
download | pyfilesystem-git-a5ffbc28d7cba9d60afb16dd4a6b1344bef90b9c.tar.gz |
Got tests working again
Diffstat (limited to 'fs/remote.py')
-rw-r--r-- | fs/remote.py | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/fs/remote.py b/fs/remote.py index b8df30b..9364e64 100644 --- a/fs/remote.py +++ b/fs/remote.py @@ -253,30 +253,16 @@ class RemoteFileBuffer(FileWrapper): if "w" in self.mode or "a" in self.mode or "+" in self.mode: pos = self.wrapped_file.tell() self.wrapped_file.seek(0) - -# chunk_size = 64*1024 -# f = None -# try: -# f = self.fs.wrapped_fs.open(self.path, 'wb') -# chunk = self.wrapped_file.read(chunk_size) -# while chunk: -# f.write(chunk) -# chunk = self.wrapped_file.read(chunk_size) -# finally: -# if f is not None: -# f.close() - - self.fs.setcontents(self.path, self.wrapped_file) - + self.fs.setcontents(self.path, self.wrapped_file) self.wrapped_file.seek(pos) - def close(self): + def close(self): with self._lock: - if not self.closed: + if not self.closed: self._setcontents() if self._rfile is not None: self._rfile.close() - super(RemoteFileBuffer,self).close() + super(RemoteFileBuffer,self).close() class ConnectionManagerFS(LazyFS): @@ -345,6 +331,7 @@ class ConnectionManagerFS(LazyFS): if not self._poll_thread: target = self._poll_connection self._poll_thread = threading.Thread(target=target) + self._poll_thread.daemon = True self._poll_thread.start() self._connection_cond.wait(timeout) finally: |