Add a new RadosGW storage engine. Allow engines to distinguish not only between those that can support direct uploads and downloads, but those that support doing it through the browser. Rename resumeable->resumable.

This commit is contained in:
Jake Moshenko 2014-09-09 15:54:03 -04:00
parent dd4037e324
commit 29d40db5ea
12 changed files with 147 additions and 176 deletions

View file

@ -1,4 +1,3 @@
import os
import shutil
@ -80,3 +79,14 @@ class LocalStorage(BaseStorage):
os.remove(path)
except OSError:
pass
def get_checksum(self, path):
path = self._init_path(path)
sha_hash = hashlib.sha256()
with open(path, 'r') as to_hash:
while True:
buf = to_hash.read(self.buffer_size)
if not buf:
break
sha_hash.update(buf)
return sha_hash.hexdigest()[:7]