コード例 #1
0
ファイル: __init__.py プロジェクト: PSyton/django-compress
 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 ''
コード例 #2
0
ファイル: __init__.py プロジェクト: PSyton/django-compress
 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 ''
コード例 #3
0
ファイル: packager.py プロジェクト: PSyton/django-compress
 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
コード例 #4
0
ファイル: __init__.py プロジェクト: PSyton/django-compress
 def save_file(self, path, content):
     file = storage.open(path, 'wb')
     file.write(content)
     file.close()
     return path
コード例 #5
0
ファイル: __init__.py プロジェクト: PSyton/django-compress
 def read_file(self, path):
     file = storage.open(path, 'rb')
     content = file.read()
     file.close()
     return content
コード例 #6
0
ファイル: __init__.py プロジェクト: PSyton/django-compress
 def read_file(self, path):
     """Read file content in binary mode"""
     file = storage.open(path, 'rb')
     content = file.read()
     file.close()
     return content
コード例 #7
0
 def save_file(self, path, content):
     file = storage.open(path, 'wb')
     file.write(content)
     file.close()
     return path
コード例 #8
0
 def read_file(self, path):
     file = storage.open(path, 'rb')
     content = file.read()
     file.close()
     return content
コード例 #9
0
ファイル: packager.py プロジェクト: mgan59/django-compress
 def save_file(self, filename, content):
     file = storage.open(filename, mode='wb+')
     file.write(content)
     file.close()
コード例 #10
0
ファイル: __init__.py プロジェクト: PSyton/django-compress
 def read_file(self, path):
     """Read file content in binary mode"""
     file = storage.open(path, 'rb')
     content = file.read()
     file.close()
     return content