From: Nikos Skalkotos Date: Fri, 20 Apr 2012 14:44:33 +0000 (+0300) Subject: Fix pep8 errors X-Git-Tag: v0.1~104 X-Git-Url: https://code.grnet.gr/git/snf-image-creator/commitdiff_plain/6152a5592cfadb062af05dd48c6e8f204ff001b6 Fix pep8 errors --- diff --git a/image_creator/kamaki_wrapper.py b/image_creator/kamaki_wrapper.py index 5be0c33..2c0db38 100644 --- a/image_creator/kamaki_wrapper.py +++ b/image_creator/kamaki_wrapper.py @@ -73,10 +73,10 @@ class Kamaki: 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: @@ -86,4 +86,4 @@ class Kamaki: 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 : diff --git a/image_creator/util.py b/image_creator/util.py index 2805de7..718b819 100644 --- a/image_creator/util.py +++ b/image_creator/util.py @@ -100,9 +100,10 @@ def progress(message=''): 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: