Skip to content
Snippets Groups Projects
Commit 6152a559 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Fix pep8 errors

parent 8e3065a0
No related branches found
No related tags found
No related merge requests found
...@@ -73,10 +73,10 @@ class Kamaki: ...@@ -73,10 +73,10 @@ class Kamaki:
raise FatalError("Pithos client: %d %s" % \ raise FatalError("Pithos client: %d %s" % \
(e.status, e.message)) (e.status, e.message))
try: try:
hash_progress = progress("(1/2) Calculating block hashes:") hash_progress = progress("(1/2) Calculating block hashes:")
upload_progress = progress("(2/2) Uploading missing blocks:") upload_progress = progress("(2/2) Uploading missing blocks:")
self.pithos_client.create_object(remote_path, f, size, 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.uploaded_object = "pithos://%s/%s/%s" % \
(self.account, self.container, remote_path) (self.account, self.container, remote_path)
except ClientError as e: except ClientError as e:
...@@ -86,4 +86,4 @@ class Kamaki: ...@@ -86,4 +86,4 @@ class Kamaki:
def register(self, metadata): def register(self, metadata):
pass pass
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
...@@ -100,9 +100,10 @@ def progress(message=''): ...@@ -100,9 +100,10 @@ def progress(message=''):
yield # suppress the StopIteration exception yield # suppress the StopIteration exception
return progress_generator 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() md5 = hashlib.md5()
with open(filename, "r") as src: with open(filename, "r") as src:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment