Exemplo n.º 1
0
 def read_file(self, path):
     """Read file content in binary mode"""
     if storage.exists(path):
         file = storage.open(path, mode='rb')
         content = file.read().decode('utf8')
         file.close()
         return content
     return ''
Exemplo n.º 2
0
 def read_file(self, path):
     """Read file content in binary mode"""
     if storage.exists(path):
         file = storage.open(path, mode='rb')
         content = file.read().decode('utf8')
         file.close()
         return content
     return ''
Exemplo n.º 3
0
 def save_file(self, filename, content):
     try:
         makeDirs(filename)
         file = storage.open(filename, mode="wb+")
         file.write(content.encode("utf8"))
         file.close()
     except Exception:
         return False
     return True
Exemplo n.º 4
0
 def save_file(self, path, content):
     file = storage.open(path, 'wb')
     file.write(content)
     file.close()
     return path
Exemplo n.º 5
0
 def read_file(self, path):
     file = storage.open(path, 'rb')
     content = file.read()
     file.close()
     return content
Exemplo n.º 6
0
 def read_file(self, path):
     """Read file content in binary mode"""
     file = storage.open(path, 'rb')
     content = file.read()
     file.close()
     return content
Exemplo n.º 7
0
 def save_file(self, path, content):
     file = storage.open(path, 'wb')
     file.write(content)
     file.close()
     return path
Exemplo n.º 8
0
 def read_file(self, path):
     file = storage.open(path, 'rb')
     content = file.read()
     file.close()
     return content
Exemplo n.º 9
0
 def save_file(self, filename, content):
     file = storage.open(filename, mode='wb+')
     file.write(content)
     file.close()
Exemplo n.º 10
0
 def read_file(self, path):
     """Read file content in binary mode"""
     file = storage.open(path, 'rb')
     content = file.read()
     file.close()
     return content