Fix pep8 errors
authorNikos Skalkotos <skalkoto@grnet.gr>
Fri, 20 Apr 2012 14:44:33 +0000 (17:44 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Fri, 20 Apr 2012 14:44:33 +0000 (17:44 +0300)
image_creator/kamaki_wrapper.py
image_creator/util.py

index 5be0c33..2c0db38 100644 (file)
@@ -73,10 +73,10 @@ class Kamaki:
                     raise FatalError("Pithos client: %d %s" % \
                                                         (e.status, e.message))
             try:
                     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,
                 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:
                 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
 
     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 :
index 2805de7..718b819 100644 (file)
@@ -100,9 +100,10 @@ def progress(message=''):
         yield  # suppress the StopIteration exception
     return progress_generator
 
         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:
 
     md5 = hashlib.md5()
     with open(filename, "r") as src: