Commit b7b3d6c7 authored by marcel's avatar marcel
Browse files

Fix get_file_content in remote file system.

parent 7525b5fb
......@@ -476,12 +476,10 @@ class FileSystem(object):
return True, "File saved!"
def get_file_content(self, path, offset=0, size=None):
path = self.expand(path)
f = open(path, "rb")
f.seek(offset)
content = f.read(size)
f.close()
def get_file_content(self, path, offset=0, length=None):
with open(self.expand(path), "rb") as f:
f.seek(offset)
content = f.read() if length is None else f.read(length)
return content
def get_mtime(self, 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