Clean-up the code using flake8
authorNikos Skalkotos <skalkoto@grnet.gr>
Fri, 22 Mar 2013 12:57:06 +0000 (14:57 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Fri, 22 Mar 2013 12:57:31 +0000 (14:57 +0200)
13 files changed:
image_creator/bundle_volume.py
image_creator/dialog_menu.py
image_creator/dialog_wizard.py
image_creator/disk.py
image_creator/kamaki_wrapper.py
image_creator/main.py
image_creator/os_type/freebsd.py
image_creator/os_type/hurd.py
image_creator/os_type/netbsd.py
image_creator/os_type/ubuntu.py
image_creator/os_type/unix.py
image_creator/os_type/windows.py
image_creator/util.py

index 9a9a366..aca14b3 100644 (file)
@@ -380,9 +380,10 @@ class BundleVolume(object):
 
             target = tempfile.mkdtemp()
             try:
 
             target = tempfile.mkdtemp()
             try:
-                absmpoints = self._mount(target,
-                                         [(mapped[i], filesystem[i].mpoint)
-                                         for i in mapped.keys()])
+                self._mount(
+                    target,
+                    [(mapped[i], filesystem[i].mpoint) for i in mapped.keys()])
+
                 excluded = self._to_exclude()
 
                 rsync = Rsync(self.out)
                 excluded = self._to_exclude()
 
                 rsync = Rsync(self.out)
index 55bcd4e..07fa205 100644 (file)
@@ -33,7 +33,6 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-import sys
 import os
 import textwrap
 import StringIO
 import os
 import textwrap
 import StringIO
@@ -65,7 +64,7 @@ CONFIGURATION_TASKS = [
 ]
 
 
 ]
 
 
-class metadata_monitor(object):
+class MetadataMonitor(object):
     def __init__(self, session, meta):
         self.session = session
         self.meta = meta
     def __init__(self, session, meta):
         self.session = session
         self.meta = meta
@@ -554,7 +553,7 @@ def sysprep(session):
                             del session['checksum']
 
                         # Monitor the metadata changes during syspreps
                             del session['checksum']
 
                         # Monitor the metadata changes during syspreps
-                        with metadata_monitor(session, image_os.meta):
+                        with MetadataMonitor(session, image_os.meta):
                             image_os.do_sysprep()
                             infobox.finalize()
 
                             image_os.do_sysprep()
                             infobox.finalize()
 
@@ -590,7 +589,7 @@ def shrink(session):
 
     if not d.yesno("%s\n\nDo you want to continue?" % msg, width=WIDTH,
                    height=12, title="Image Shrinking"):
 
     if not d.yesno("%s\n\nDo you want to continue?" % msg, width=WIDTH,
                    height=12, title="Image Shrinking"):
-        with metadata_monitor(session, dev.meta):
+        with MetadataMonitor(session, dev.meta):
             infobox = InfoBoxOutput(d, "Image Shrinking", height=4)
             dev.out.add(infobox)
             try:
             infobox = InfoBoxOutput(d, "Image Shrinking", height=4)
             dev.out.add(infobox)
             try:
@@ -640,7 +639,6 @@ def customization_menu(session):
 
 def main_menu(session):
     d = session['dialog']
 
 def main_menu(session):
     d = session['dialog']
-    dev = session['device']
 
     update_background_title(session)
 
 
     update_background_title(session)
 
index 0b1b1d7..31aa4a2 100644 (file)
@@ -33,7 +33,6 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-import dialog
 import time
 import StringIO
 
 import time
 import StringIO
 
index a51611e..9017d45 100644 (file)
@@ -43,7 +43,6 @@ import os
 import tempfile
 import uuid
 import re
 import tempfile
 import uuid
 import re
-import sys
 import guestfs
 import shutil
 from sendfile import sendfile
 import guestfs
 import shutil
 from sendfile import sendfile
index 5963990..f5a40c7 100644 (file)
@@ -39,8 +39,6 @@ from kamaki.clients.image import ImageClient
 from kamaki.clients.pithos import PithosClient
 from kamaki.clients.astakos import AstakosClient
 
 from kamaki.clients.pithos import PithosClient
 from kamaki.clients.astakos import AstakosClient
 
-from image_creator.util import FatalError
-
 
 class Kamaki(object):
 
 
 class Kamaki(object):
 
index 42b480e..497fedf 100644 (file)
@@ -34,7 +34,6 @@
 # or implied, of GRNET S.A.
 
 from image_creator import __version__ as version
 # or implied, of GRNET S.A.
 
 from image_creator import __version__ as version
-from image_creator import util
 from image_creator.disk import Disk
 from image_creator.util import FatalError, MD5
 from image_creator.output.cli import SilentOutput, SimpleOutput, \
 from image_creator.disk import Disk
 from image_creator.util import FatalError, MD5
 from image_creator.output.cli import SilentOutput, SimpleOutput, \
@@ -196,7 +195,6 @@ def image_creator():
         except ClientError as e:
             raise FatalError("Astakos client: %d %s" % (e.status, e.message))
 
         except ClientError as e:
             raise FatalError("Astakos client: %d %s" % (e.status, e.message))
 
-
     disk = Disk(options.source, out, options.tmp)
 
     def signal_handler(signum, frame):
     disk = Disk(options.source, out, options.tmp)
 
     def signal_handler(signum, frame):
index b5e7491..33ba887 100644 (file)
@@ -31,7 +31,7 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from image_creator.os_type.unix import Unix, sysprep
+from image_creator.os_type.unix import Unix
 
 
 class Freebsd(Unix):
 
 
 class Freebsd(Unix):
index 98c65e5..a294ca1 100644 (file)
@@ -31,7 +31,7 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from image_creator.os_type.unix import Unix, sysprep
+from image_creator.os_type.unix import Unix
 
 
 class Hurd(Unix):
 
 
 class Hurd(Unix):
index 57e50e4..bfb94d6 100644 (file)
@@ -31,7 +31,7 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from image_creator.os_type.unix import Unix, sysprep
+from image_creator.os_type.unix import Unix
 
 
 class Netbsd(Unix):
 
 
 class Netbsd(Unix):
index 6a048e5..cc6e973 100644 (file)
@@ -31,7 +31,7 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from image_creator.os_type.linux import Linux, sysprep
+from image_creator.os_type.linux import Linux
 
 
 class Ubuntu(Linux):
 
 
 class Ubuntu(Linux):
index 2cd8452..a1ef905 100644 (file)
@@ -32,7 +32,6 @@
 # or implied, of GRNET S.A.
 
 import re
 # or implied, of GRNET S.A.
 
 import re
-import sys
 
 from image_creator.os_type import OSBase, sysprep
 
 
 from image_creator.os_type import OSBase, sysprep
 
index 405a7d9..7ba6767 100644 (file)
@@ -31,7 +31,7 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from image_creator.os_type import OSBase, sysprep
+from image_creator.os_type import OSBase
 
 
 class Windows(OSBase):
 
 
 class Windows(OSBase):
index 8730143..b4d5000 100644 (file)
@@ -31,7 +31,6 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-import sys
 import sh
 import hashlib
 import time
 import sh
 import hashlib
 import time