raise FatalError("Pithos client: %d %s" % \
(e.status, e.message))
try:
- hash_progress = progress("(1/2) Calculating block hashes:")
- upload_progress = progress("(2/2) Uploading missing blocks:")
+ hash_progress = progress("(1/2) Calculating block hashes:")
+ upload_progress = progress("(2/2) Uploading missing blocks:")
self.pithos_client.create_object(remote_path, f, size,
- hash_progress, upload_progress)
+ hash_progress, upload_progress)
self.uploaded_object = "pithos://%s/%s/%s" % \
(self.account, self.container, remote_path)
except ClientError as e:
def register(self, metadata):
pass
-# vim: set sta sts=4 shiftwidth=4 sw=4 et ai
+# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
yield # suppress the StopIteration exception
return progress_generator
-def md5(filename, size, progress = None):
- BLOCKSIZE = 2^22 # 4MB
+def md5(filename, size, progress=None):
+
+ BLOCKSIZE = 2 ^ 22 # 4MB
md5 = hashlib.md5()
with open(filename, "r") as src: