Commit af923a7c by willmcgugan

Work in progress for memoryfs

parent 0d2f59a5
...@@ -21,14 +21,22 @@ class MemoryFile(object): ...@@ -21,14 +21,22 @@ class MemoryFile(object):
return False return False
return True return True
self.mem_file = None
if check_mode('w'): if check_mode('w'):
self.mem_file = StringIO()
if check_mode('+'): if check_mode('+'):
self.mem_file.write(value) self.mem_file = StringIO(value)
else:
self.mem_file = StringIO()
elif check_mode('r'): elif check_mode('r'):
if check_mode('+'):
self.mem_file = StringIO(value)
else:
self.mem_file = StringIO(value) self.mem_file = StringIO(value)
if check_mode('a'):
self.mem_file.seek(0, os.SEEK_END)
self.mem_file = None self.mem_file = None
......
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