[elbe-devel] [PATCH 7/7] pep8: fix E501 line too long (X > 79 characters)

Manuel Traut manut at linutronix.de
Wed Dec 20 22:11:47 CET 2017


to match the 79 char limit the following changes were made in different
files:

 * strings in brackets are seperated with their limiters and splitted into
   multiple lines

 * if statements are splitted into multiple lines using '\'

 * super long function calls with a lot of parameters are splitted into
   multiple lines

 * additional brackets are added to allow additional line breaks

 * long lines accessing arrays are put into multiple lines after '['

 * use shorter variable names if this makes it possible to put a statement
   into a single line

 * rework comments to fit into the 79 char limit

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/asciidoclog.py           |  8 ++--
 elbepack/commands/adjustpkgs.py   |  9 +++--
 elbepack/commands/buildchroot.py  |  4 +-
 elbepack/commands/chg_archive.py  |  6 ++-
 elbepack/commands/control.py      | 11 ++++--
 elbepack/commands/diff.py         | 15 ++++----
 elbepack/commands/init.py         |  7 ++--
 elbepack/commands/initvm.py       |  3 +-
 elbepack/commands/parselicence.py |  6 ++-
 elbepack/commands/pkgdiff.py      | 12 ++++--
 elbepack/commands/prjrepo.py      |  9 +++--
 elbepack/commands/sign.py         |  3 +-
 elbepack/daemons/soap/esoap.py    | 10 ++---
 elbepack/daemons/soap/faults.py   |  3 +-
 elbepack/db.py                    | 12 ++++--
 elbepack/debianize/barebox.py     |  3 +-
 elbepack/debianize/base.py        |  4 +-
 elbepack/debianize/kernel.py      |  7 ++--
 elbepack/efilesystem.py           | 12 +++---
 elbepack/elbeproject.py           | 78 ++++++++++++++++++++-------------------
 elbepack/elbexml.py               | 15 ++++----
 elbepack/fstab.py                 |  8 ++--
 elbepack/gpg.py                   |  5 ++-
 elbepack/hdimg.py                 | 11 +++---
 elbepack/initvmaction.py          | 31 +++++++++-------
 elbepack/pbuilder.py              | 27 ++++++--------
 elbepack/pkgarchive.py            |  4 +-
 elbepack/pkgutils.py              |  9 +++--
 elbepack/projectmanager.py        | 24 ++++++------
 elbepack/repomanager.py           | 24 +++++-------
 elbepack/rfs.py                   | 58 ++++++++++++++++-------------
 elbepack/rpcaptcache.py           | 25 ++++++++-----
 elbepack/soapclient.py            | 10 ++---
 elbepack/toolchain.py             |  4 +-
 elbepack/validate.py              |  4 +-
 elbepack/virtapt.py               | 14 ++++---
 setup.py                          | 21 +++++++----
 37 files changed, 284 insertions(+), 232 deletions(-)

diff --git a/elbepack/asciidoclog.py b/elbepack/asciidoclog.py
index fc44209f..6a30936a 100644
--- a/elbepack/asciidoclog.py
+++ b/elbepack/asciidoclog.py
@@ -35,12 +35,12 @@ class LogBase(object):
         self.printo("|=====================================")
 
     def verbatim_start(self):
-        self.printo(
-            "------------------------------------------------------------------------------")
+        self.printo("---------------------------------------"
+                    "---------------------------------------")
 
     def verbatim_end(self):
-        self.printo(
-            "------------------------------------------------------------------------------")
+        self.printo("---------------------------------------"
+                    "---------------------------------------")
         self.printo()
 
     def do(self, cmd, allow_fail=False, input=None):
diff --git a/elbepack/commands/adjustpkgs.py b/elbepack/commands/adjustpkgs.py
index 0ef80be4..ca949b9a 100644
--- a/elbepack/commands/adjustpkgs.py
+++ b/elbepack/commands/adjustpkgs.py
@@ -39,9 +39,12 @@ class adjpkg(object):
             for p in cache:
                 if not p.is_installed:
                     continue
-                if p.essential or p.is_auto_installed or (
-                        p.name in pkglist) or p.installed.priority == "important" or p.installed.priority == "required":
-                    continue
+                if p.essential or \
+                   p.is_auto_installed or \
+                   p.name in pkglist or \
+                   p.installed.priority == "important" or \
+                   p.installed.priority == "required":
+                        continue
                 print("MARK REMOVE %s" % p.name)
                 p.mark_delete(auto_fix=False, purge=True)
 
diff --git a/elbepack/commands/buildchroot.py b/elbepack/commands/buildchroot.py
index 5aab4270..4950c86b 100644
--- a/elbepack/commands/buildchroot.py
+++ b/elbepack/commands/buildchroot.py
@@ -89,8 +89,8 @@ def run_command(argv):
         sys.exit(20)
 
     if opt.skip_cdrom:
-        print(
-            "WARNING: Skip CDROMS is now the default, use --build-bin to build binary CDROM")
+        print("WARNING: Skip CDROMS is now the default, "
+              "use --build-bin to build binary CDROM")
 
     try:
         project = ElbeProject(opt.target, args[0], opt.output, opt.name,
diff --git a/elbepack/commands/chg_archive.py b/elbepack/commands/chg_archive.py
index 61dd1173..b276b25d 100644
--- a/elbepack/commands/chg_archive.py
+++ b/elbepack/commands/chg_archive.py
@@ -32,11 +32,13 @@ def enbase(fname):
 def run_command(argv):
 
     oparser = OptionParser(
-        usage="usage: %prog chg_archive [options] <xmlfile> [<archive>|<directory>]")
+        usage="usage: %prog chg_archive [options] <xmlfile> "
+              "[<archive>|<directory>]")
     oparser.add_option(
         "--keep-attributes",
         action="store_true",
-        help="keep file owners and groups, if not specified all files will belong to root:root",
+        help="keep file owners and groups, if not specified all files will "
+             "belong to root:root",
         dest="keep_attributes",
         default=False)
 
diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index 1e70d4c7..7279f11c 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -39,7 +39,8 @@ def run_command(argv):
         "--retries",
         dest="retries",
         default="10",
-        help="How many times to retry the connection to the server before giving up (default is 10 times, yielding 10 seconds).")
+        help="How many times to retry the connection to the server before "
+             "giving up (default is 10 times, yielding 10 seconds).")
 
     oparser.add_option(
         "--build-bin",
@@ -130,9 +131,11 @@ def run_command(argv):
     try:
         v_server = control.service.get_version()
         if v_server != elbe_version:
-            print("elbe v%s is used in initvm, this is not compatible with \
-elbe v%s that is used on this machine. Please install same \
-versions of elbe in initvm and on your machine." % (v_server, elbe_version), file=sys.stderr)
+            print("elbe v%s is used in initvm, this is not compatible with "
+                  "elbe v%s that is used on this machine. Please install same "
+                  "versions of elbe in initvm and on your machine." % (
+                      v_server, elbe_version), file=sys.stderr)
+
             if not (opt.ignore_version):
                 sys.exit(20)
     except AttributeError:
diff --git a/elbepack/commands/diff.py b/elbepack/commands/diff.py
index 3da450e5..181caf44 100644
--- a/elbepack/commands/diff.py
+++ b/elbepack/commands/diff.py
@@ -50,16 +50,17 @@ def walk_generated(gen_path, fix_path, exclude):
                                     (gen_fname, fix_fname))
                                 file_differ.append(os.path.join(infs_root, f))
                         else:
-                            if not (
-                                    os.readlink(gen_fname) == os.readlink(fix_fname)):
-                                print(
-                                    "symlinks %s and %s differ" %
-                                    (gen_fname, fix_fname))
+                            if not (os.readlink(gen_fname) ==
+                                    os.readlink(fix_fname)):
+                                print("symlinks %s and %s differ" % (
+                                    gen_fname, fix_fname))
                                 file_differ.append(os.path.join(infs_root, f))
 
-                elif not os.path.exists(gen_fname) and os.path.exists(fix_fname):
+                elif not os.path.exists(gen_fname) and \
+                        os.path.exists(fix_fname):
                     print("file %s only exists in fixed image" % (fix_fname))
-                elif os.path.exists(gen_fname) and not os.path.exists(fix_fname):
+                elif os.path.exists(gen_fname) and not \
+                        os.path.exists(fix_fname):
                     print("file %s only exists in gen image" % (gen_fname))
                     file_to_rm.append(os.path.join(infs_root, f))
 
diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
index dfe538e5..3161e6b6 100644
--- a/elbepack/commands/init.py
+++ b/elbepack/commands/init.py
@@ -62,7 +62,8 @@ def run_command(argv):
         dest="nesting",
         action="store_true",
         default=False,
-        help="allow initvm to support nested kvm. This makes /proc/cpuinfo inside initvm differ per host.")
+        help="allow initvm to support nested kvm. "
+             "This makes /proc/cpuinfo inside initvm differ per host.")
 
     (opt, args) = oparser.parse_args(argv)
 
@@ -109,8 +110,8 @@ def run_command(argv):
     elif opt.proxy:
         http_proxy = opt.proxy
     elif xml.has("initvm/mirror/primary_proxy"):
-        http_proxy = xml.text(
-            "initvm/mirror/primary_proxy").strip().replace("LOCALMACHINE", "localhost")
+        http_proxy = xml.text("initvm/mirror/primary_proxy")
+        http_proxy = http_proxy.strip().replace("LOCALMACHINE", "localhost")
 
     if opt.cdrom:
         mirror = xml.node("initvm/mirror")
diff --git a/elbepack/commands/initvm.py b/elbepack/commands/initvm.py
index 21a1dc7f..e26ce82a 100644
--- a/elbepack/commands/initvm.py
+++ b/elbepack/commands/initvm.py
@@ -61,7 +61,8 @@ def run_command(argv):
         dest="nesting",
         action="store_true",
         default=False,
-        help="allow initvm to support nested kvm. This makes /proc/cpuinfo inside initvm differ per host.")
+        help="allow initvm to support nested kvm. "
+             "This makes /proc/cpuinfo inside initvm differ per host.")
 
     (opt, args) = oparser.parse_args(argv)
 
diff --git a/elbepack/commands/parselicence.py b/elbepack/commands/parselicence.py
index cda4667d..34b2d1e9 100644
--- a/elbepack/commands/parselicence.py
+++ b/elbepack/commands/parselicence.py
@@ -135,13 +135,15 @@ def run_command(argv):
         action="store_true",
         dest="use_nomos",
         default=False,
-        help="Use the external nomos tool on the copyright text, and record the ouput in out xml")
+        help="Use the external nomos tool on the copyright text, "
+             "and record the ouput in out xml")
     oparser.add_option(
         "--errors-only",
         action="store_true",
         dest="only_errors",
         default=False,
-        help="Only Output Packages with errors, needing a fix in the mapping file")
+        help="Only Output Packages with errors, "
+             "needing a fix in the mapping file")
     oparser.add_option("--tvout", dest="tagvalue",
                        help="tag value output filename")
 
diff --git a/elbepack/commands/pkgdiff.py b/elbepack/commands/pkgdiff.py
index c1bd2390..77f22edf 100644
--- a/elbepack/commands/pkgdiff.py
+++ b/elbepack/commands/pkgdiff.py
@@ -53,8 +53,10 @@ def run_command(argv):
     gen_pkgs = {}
     for p in gen_cache.packages:
         if opt.noauto:
-            if p.current_ver and not gc[p.name].is_auto_installed and not p.essential:
-                gen_pkgs[p.name] = p.current_ver
+            if p.current_ver and not \
+               gc[p.name].is_auto_installed and not \
+               p.essential:
+                    gen_pkgs[p.name] = p.current_ver
         else:
             if p.current_ver and not p.essential:
                 gen_pkgs[p.name] = p.current_ver
@@ -69,8 +71,10 @@ def run_command(argv):
     fix_pkgs = {}
     for p in fix_cache.packages:
         if opt.noauto:
-            if p.current_ver and not fc[p.name].is_auto_installed and not p.essential:
-                fix_pkgs[p.name] = p.current_ver
+            if p.current_ver and not \
+               fc[p.name].is_auto_installed and not \
+               p.essential:
+                    fix_pkgs[p.name] = p.current_ver
         else:
             if p.current_ver and not p.essential:
                 fix_pkgs[p.name] = p.current_ver
diff --git a/elbepack/commands/prjrepo.py b/elbepack/commands/prjrepo.py
index 110f0eeb..8215bb9b 100644
--- a/elbepack/commands/prjrepo.py
+++ b/elbepack/commands/prjrepo.py
@@ -100,9 +100,12 @@ def run_command(argv):
     try:
         v_server = control.service.get_version()
         if v_server != elbe_version:
-            print("elbe v%s is used in initvm, this is not compatible with \
-elbe v%s that is used on this machine. Please install same \
-versions of elbe in initvm and on your machine." % (v_server, elbe_version), file=sys.stderr)
+            print("elbe v%s is used in initvm, this is not compatible witha"
+                  "elbe v%s that is used on this machine. Please install same "
+                  "versions of elbe in initvm and on your machine." % (
+                      v_server, elbe_version),
+                  file=sys.stderr)
+
             if not (opt.ignore_version):
                 sys.exit(20)
     except AttributeError:
diff --git a/elbepack/commands/sign.py b/elbepack/commands/sign.py
index 410d8f37..3f398272 100644
--- a/elbepack/commands/sign.py
+++ b/elbepack/commands/sign.py
@@ -11,7 +11,8 @@ from elbepack.gpg import sign_file
 def run_command(argv):
     if(len(argv) != 2):
         print("Wrong number of arguments.")
-        print("Please pass the name of the file to sign and a valid gnupg fingerprint.")
+        print("Please pass the name of the file to sign "
+              "and a valid gnupg fingerprint.")
         return
     else:
         sign_file(argv[0], argv[1])
diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index a9077635..3a6f95d1 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -76,9 +76,9 @@ class ESoap (ServiceBase):
         if (part == 0):
             if self.app.pm.db.is_busy(builddir):
                 return -1
-            self.app.pm.db.set_busy(builddir,
-                                    ["empty_project", "needs_build", "has_changes",
-                                     "build_done", "build_failed"])
+            self.app.pm.db.set_busy(builddir, ["empty_project", "needs_build",
+                                               "has_changes", "build_done",
+                                               "build_failed"])
             # truncate file
             with open(fn, 'w') as fp:
                 fp.write('')
@@ -256,8 +256,8 @@ class ESoap (ServiceBase):
     @authenticated_uid
     @soap_faults
     def finish_upload_orig(self, uid, builddir):
-        # If we support more than one orig, we need to put the orig_files into some
-        # list here.
+        # If we support more than one orig, we need to put the orig_files into
+        # some list here.
         # We still need the notion of a "current" orig during file upload.
         pass
 
diff --git a/elbepack/daemons/soap/faults.py b/elbepack/daemons/soap/faults.py
index 773f02ed..8fb7311d 100644
--- a/elbepack/daemons/soap/faults.py
+++ b/elbepack/daemons/soap/faults.py
@@ -41,7 +41,8 @@ class SoapElbeNotLoggedIn(Fault):
         Fault.__init__(
             self,
             faultcode="ElbeNotLoggedIn",
-            faultstring="Not authenticated ! Cant let you perform this command.")
+            faultstring="Not authenticated ! "
+                        "Cant let you perform this command.")
 
 
 class SoapElbeNotAuthorized(Fault):
diff --git a/elbepack/db.py b/elbepack/db.py
index 3f684865..5dd4e52e 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -141,7 +141,8 @@ class ElbeDB(object):
             dos2unix(builddir + "/postbuild.sh")
 
             return self._update_project_file(
-                s, builddir, "postbuild.sh", "application/sh", "postbuild script")
+                s, builddir,
+                "postbuild.sh", "application/sh", "postbuild script")
 
     def set_savesh(self, builddir, savesh_file):
         if not os.path.exists(builddir):
@@ -175,7 +176,8 @@ class ElbeDB(object):
             dos2unix(builddir + "/save.sh")
 
             return self._update_project_file(
-                s, builddir, "save.sh", "application/sh", "version save script")
+                s, builddir,
+                "save.sh", "application/sh", "version save script")
 
     def set_presh(self, builddir, presh_file):
         if not os.path.exists(builddir):
@@ -241,7 +243,8 @@ class ElbeDB(object):
             dos2unix(builddir + "/post.sh")
 
             return self._update_project_file(
-                s, builddir, "post.sh", "application/sh", "post install script")
+                s, builddir,
+                "post.sh", "application/sh", "post install script")
 
     def set_xml(self, builddir, xml_file):
         # This method can throw: ElbeDBError, ValidationError, OSError
@@ -791,7 +794,8 @@ class ElbeDB(object):
                 images = set(ep.targetfs.images or [])
                 for img in images:
                     self._update_project_file(
-                        s, p.builddir, img, "application/octet-stream", "Image")
+                        s, p.builddir, img,
+                        "application/octet-stream", "Image")
 
             # Add other generated files
             self._update_project_file(
diff --git a/elbepack/debianize/barebox.py b/elbepack/debianize/barebox.py
index 0cc64777..88782545 100644
--- a/elbepack/debianize/barebox.py
+++ b/elbepack/debianize/barebox.py
@@ -70,7 +70,8 @@ class BareBox (DebianizeBase):
         copyfile(os.path.join(self.tmpl_dir, 'barebox-tools.install'),
                  'debian/barebox-tools-' + pkg_name + '.install')
 
-        self.hint = "use 'dpkg-buildpackage -a%s' to build the package" % self.deb['p_arch']
+        self.hint = "use 'dpkg-buildpackage -a%s' to build the package" % (
+                self.deb['p_arch'])
 
 
 DebianizeBase.register(BareBox)
diff --git a/elbepack/debianize/base.py b/elbepack/debianize/base.py
index 44d3cf01..c14df2fa 100644
--- a/elbepack/debianize/base.py
+++ b/elbepack/debianize/base.py
@@ -99,8 +99,8 @@ class DebianizeBase (FormMultiPage):
         self.deb['p_arch'] = self.archs[self.p_arch.get_value()[0]]
         self.deb['m_name'] = self.m_name.get_value()
         self.deb['m_mail'] = self.m_mail.get_value()
-        self.deb['source_format'] = self.formats[self.source_format.get_value()[
-            0]]
+        self.deb['source_format'] = self.formats[
+                self.source_format.get_value()[0]]
         self.deb['release'] = self.releases[self.release.get_value()[0]]
 
         os.mkdir('debian')
diff --git a/elbepack/debianize/kernel.py b/elbepack/debianize/kernel.py
index fa33ea1b..e3c8f2b0 100644
--- a/elbepack/debianize/kernel.py
+++ b/elbepack/debianize/kernel.py
@@ -56,8 +56,8 @@ class Kernel (DebianizeBase):
         self.deb['loadaddr'] = self.loadaddr.get_value()
         self.deb['defconfig'] = self.defconfig.get_value()
         self.deb['imgtype'] = self.imgtypes[self.imgtype.get_value()[0]]
-        self.deb['imgtype_install'] = self.imgtypes_install[self.imgtype.get_value()[
-            0]]
+        self.deb['imgtype_install'] = self.imgtypes_install[
+                self.imgtype.get_value()[0]]
         self.deb['cross_compile'] = self.cross.get_value()
         self.deb['k_version'] = self.k_version.get_value()
 
@@ -86,7 +86,8 @@ class Kernel (DebianizeBase):
         copyfile(os.path.join(self.tmpl_dir, 'linux-headers.install'),
                  'debian/linux-headers-' + pkg_name + '.install')
 
-        self.hint = "use 'dpkg-buildpackage -a%s' to build the package" % self.deb['p_arch']
+        self.hint = "use 'dpkg-buildpackage -a%s' to build the package" % (
+                self.deb['p_arch'])
 
 
 DebianizeBase.register(Kernel)
diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index ebe1bca2..5834879f 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -147,8 +147,8 @@ class ElbeFilesystem(Filesystem):
 
             if f is not None:
                 f.write(unicode(os.path.basename(dir)))
-                f.write(
-                    u":\n================================================================================")
+                f.write(u":\n======================================"
+                        "==========================================")
                 f.write(u"\n")
                 f.write(lic_text)
                 f.write(u"\n\n")
@@ -311,12 +311,12 @@ class TargetFs(ChRootFilesystem):
                 options = ''
                 if self.xml.has("target/package/tar/options"):
                     options = self.xml.text("target/package/tar/options")
-                cmd = "tar cfz %(targetdir)s/%(targz_name)s -C %(sourcedir)s %(options)s ."
+                cmd = "tar cfz %(dest)s/%(fname)s -C %(sdir)s %(options)s ."
                 args = dict(
                     options=options,
-                    targetdir=targetdir,
-                    targz_name=targz_name,
-                    sourcedir=self.fname('')
+                    dest=targetdir,
+                    fname=targz_name,
+                    sdir=self.fname('')
                 )
                 self.log.do(cmd % args)
                 # only append filename if creating tarball was successful
diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 99cff3e4..5056ffa4 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -9,7 +9,10 @@ import io
 
 from elbepack.asciidoclog import ASCIIDocLog, StdoutLog
 from elbepack.shellhelper import CommandError
-from elbepack.elbexml import ElbeXML, NoInitvmNode, ValidationError, ValidationMode
+
+from elbepack.elbexml import (ElbeXML, NoInitvmNode,
+                              ValidationError, ValidationMode)
+
 from elbepack.rfs import BuildEnv
 from elbepack.rpcaptcache import get_rpcaptcache
 from elbepack.efilesystem import TargetFs
@@ -21,7 +24,9 @@ from elbepack.dump import check_full_pkgs
 
 from elbepack.cdroms import mk_source_cdrom, mk_binary_cdrom
 
-from elbepack.pbuilder import pbuilder_write_config, pbuilder_write_repo_hook, pbuilder_write_apt_conf
+from elbepack.pbuilder import (pbuilder_write_config, pbuilder_write_repo_hook,
+                               pbuilder_write_apt_conf)
+
 from elbepack.repomanager import ProjectRepo
 from elbepack.config import cfg
 
@@ -29,7 +34,8 @@ from elbepack.config import cfg
 class IncompatibleArchitectureException(Exception):
     def __init__(self, oldarch, newarch):
         Exception.__init__(
-            self, "Cannot change architecture from %s to %s in existing project" %
+            self,
+            "Cannot change architecture from %s to %s in existing project" %
             (oldarch, newarch))
 
 
@@ -147,7 +153,8 @@ class ElbeProject (object):
 
         with self.buildenv:
             try:
-                self.get_rpcaptcache().mark_install_devpkgs(ignore_pkgs, ignore_dev_pkgs)
+                self.get_rpcaptcache().mark_install_devpkgs(ignore_pkgs,
+                                                            ignore_dev_pkgs)
             except SystemError as e:
                 self.log.printo("mark install devpkgs failed: %s" % str(e))
             try:
@@ -317,8 +324,8 @@ class ElbeProject (object):
                     reportpath, self.targetfs)
 
         # the current license code raises an exception that interrupts the hole
-        # build if a licence can't be converted to utf-8. Exception handling can
-        # be removed as soon as the licence code is more stable
+        # build if a licence can't be converted to utf-8. Exception handling
+        # can be removed as soon as the licence code is more stable
         lic_err = False
         try:
             f = io.open(
@@ -350,8 +357,8 @@ class ElbeProject (object):
             else:
                 grub_version = 202
         elif self.get_rpcaptcache().is_installed('grub-legacy'):
-            self.log.printo(
-                "package grub-legacy is installed, this is obsolete, skipping grub")
+            self.log.printo("package grub-legacy is installed, "
+                            "this is obsolete, skipping grub")
             grub_version = 0
         else:
             self.log.printo("package grub-pc is not installed, skipping grub")
@@ -418,12 +425,9 @@ class ElbeProject (object):
         try:
             for orig_fname in self.orig_files:
                 ofname = os.path.join(self.builddir, orig_fname)
-                self.log.do(
-                    'mv "%s" "%s"' %
-                    (ofname,
-                     os.path.join(
-                         self.builddir,
-                         "pdebuilder")))
+                self.log.do('mv "%s" "%s"' % (ofname,
+                                              os.path.join(self.builddir,
+                                                           "pdebuilder")))
         finally:
             self.orig_fname = None
             self.orig_files = []
@@ -441,27 +445,29 @@ class ElbeProject (object):
 
     def pdebuild_build(self):
         try:
-            self.log.do(
-                'cd "%s"; pdebuild --debbuildopts "-j%s -sa" --configfile "%s" --use-pdebuild-internal --buildresult "%s"' %
-                (os.path.join(
-                    self.builddir, "pdebuilder", "current"), cfg['pbuilder_jobs'], os.path.join(
-                    self.builddir, "pbuilderrc"), os.path.join(
-                    self.builddir, "pbuilder", "result")))
-            self.repo.remove(
-                os.path.join(
-                    self.builddir,
-                    "pdebuilder",
-                    "current",
-                    "debian",
-                    "control"))
+            self.log.do('cd "%s"; pdebuild --debbuildopts "-j%s -sa" '
+                        '--configfile "%s" '
+                        '--use-pdebuild-internal --buildresult "%s"' % (
+                            os.path.join(self.builddir,
+                                         "pdebuilder",
+                                         "current"),
+                            cfg['pbuilder_jobs'],
+                            os.path.join(self.builddir, "pbuilderrc"),
+                            os.path.join(self.builddir, "pbuilder", "result")))
+
+            self.repo.remove(os.path.join(self.builddir,
+                                          "pdebuilder",
+                                          "current",
+                                          "debian",
+                                          "control"))
 
             self.repo.include(os.path.join(self.builddir,
                                            "pbuilder", "result", "*.changes"))
         except CommandError as e:
             self.log.printo('')
             self.log.printo('Package fails to build.')
-            self.log.printo(
-                'Please make sure, that the submitted package builds in pbuilder')
+            self.log.printo('Please make sure, that the submitted package '
+                            'builds in pbuilder')
 
     def update_pbuilder(self):
         self.log.do(
@@ -501,11 +507,10 @@ class ElbeProject (object):
                 "D10elbe_apt_sources"))
 
         # Run pbuilder --create
-        self.log.do(
-            'pbuilder --create --configfile "%s" --aptconfdir "%s" --extrapackages git' %
-            (os.path.join(
-                self.builddir, "pbuilderrc"), os.path.join(
-                self.builddir, "aptconfdir")))
+        self.log.do('pbuilder --create --configfile "%s" --aptconfdir "%s" '
+                    '--extrapackages git' % (
+                        os.path.join(self.builddir, "pbuilderrc"),
+                        os.path.join(self.builddir, "aptconfdir")))
 
     def sync_xml_to_disk(self):
         try:
@@ -535,9 +540,8 @@ class ElbeProject (object):
             if os.path.isfile(elbeversionpath):
                 return True
             else:
-                self.log.printo(
-                    "%s exists, but it does not have an etc/elbe_version file." %
-                    self.chrootpath)
+                self.log.printo("%s exists, but it does not have "
+                                "an etc/elbe_version file." % self.chrootpath)
                 # Apparently we do not have a functional build environment
                 return False
         else:
diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index d2c2a6a6..a00c4f69 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -180,16 +180,16 @@ class ElbeXML(object):
         sources_lines = slist.split('\n')
 
         repos = []
-        for source_line in sources_lines:
-            source_line = re.sub(r'\[.*\] ', '', l)
-            if source_line.startswith("deb copy:"):
+        for srcline in sources_lines:
+            srcline = re.sub(r'\[.*\] ', '', l)
+            if srcline.startswith("deb copy:"):
                 # This is a cdrom, we dont verify it
                 pass
-            elif source_line.startswith("deb-src copy:"):
+            elif srcline.startswith("deb-src copy:"):
                 # This is a cdrom, we dont verify it
                 pass
-            elif source_line.startswith("deb ") or source_line.startswith("deb-src "):
-                lsplit = source_line.split(" ")
+            elif srcline.startswith("deb ") or srcline.startswith("deb-src "):
+                lsplit = srcline.split(" ")
                 url = lsplit[1]
                 suite = lsplit[2]
                 section = lsplit[3]
@@ -215,7 +215,8 @@ class ElbeXML(object):
         if self.prj.has("mirror/primary_proxy"):
             os.environ["no_proxy"] = "10.0.2.2,localhost,127.0.0.1"
             proxy = self.prj.text(
-                "mirror/primary_proxy").strip().replace("LOCALMACHINE", "10.0.2.2")
+                "mirror/primary_proxy").strip().replace("LOCALMACHINE",
+                                                        "10.0.2.2")
             os.environ["http_proxy"] = proxy
             os.environ["https_proxy"] = proxy
         else:
diff --git a/elbepack/fstab.py b/elbepack/fstab.py
index 6c639b17..1d1d7af8 100644
--- a/elbepack/fstab.py
+++ b/elbepack/fstab.py
@@ -30,8 +30,8 @@ def get_mtdnum(xml, label):
 
 def get_devicelabel(xml, node):
     if node.text("fs/type") == "ubifs":
-        return "ubi" + get_mtdnum(xml,
-                                  node.text("label")) + ":" + node.text("label")
+        return "ubi %s:%s" % (get_mtdnum(xml, node.text("label")),
+                              node.text("label"))
     else:
         return "LABEL=" + node.text("label")
 
@@ -89,8 +89,8 @@ class fstabentry(object):
         self.id = str(id)
 
     def get_str(self):
-        return "%s %s %s %s 0 %s\n" % (
-            self.source, self.mountpoint, self.fstype, self.options, self.passno)
+        return "%s %s %s %s 0 %s\n" % (self.source, self.mountpoint,
+                                       self.fstype, self.options, self.passno)
 
     def mountdepth(self):
         h = self.mountpoint
diff --git a/elbepack/gpg.py b/elbepack/gpg.py
index 2bdcd8e7..f96618af 100644
--- a/elbepack/gpg.py
+++ b/elbepack/gpg.py
@@ -46,7 +46,10 @@ class OverallStatus:
             return 20
         if self.invalid:        # invalid signature
             return 1
-        if self.sig_expired or self.key_expired or self.key_revoked or self.key_missing:
+        if self.sig_expired or \
+           self.key_expired or \
+           self.key_revoked or \
+           self.key_missing:
             return 2
 
         return 0
diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index 963c6599..281bfc93 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -380,11 +380,12 @@ def create_partition(
         sz = size_to_int(part.text("size")) / sector_size
 
     g = parted.Geometry(device=disk.device, start=current_sector, length=sz)
-    if ptype != parted.PARTITION_EXTENDED and part.text(
-            "label") in fslabel and fslabel[part.text("label")].fstype == "vfat":
-        fs = simple_fstype("fat32")
-        ppart = parted.Partition(disk, ptype, fs, geometry=g)
-        ppart.setFlag(_ped.PARTITION_LBA)
+    if ptype != parted.PARTITION_EXTENDED and \
+            part.text("label") in fslabel and \
+            fslabel[part.text("label")].fstype == "vfat":
+                fs = simple_fstype("fat32")
+                ppart = parted.Partition(disk, ptype, fs, geometry=g)
+                ppart.setFlag(_ped.PARTITION_LBA)
     else:
         ppart = parted.Partition(disk, ptype, geometry=g)
 
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index 92899930..9a91fa91 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -31,7 +31,8 @@ def cmd_exists(x): return any(os.access(os.path.join(path, x), os.X_OK)
 
 def ensure_outdir(wdfs, opt):
     if opt.outdir is None:
-        opt.outdir = "elbe-build-" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
+        opt.outdir = "elbe-build-%s" % (
+                datetime.datetime.now().strftime("%Y%m%d-%H%M%S"))
 
     print("Saving generated Files to %s" % opt.outdir)
 
@@ -93,8 +94,9 @@ class StartAction(InitVMAction):
         elif self.initvm_state() == 5:
             # Domain is shut off. Let's start it!
             self.initvm.create()
-            # TODO: Instead of waiting for five seconds check whether SOAP server is reachable
             # Wait five seconds for the initvm to boot
+            # TODO: Instead of waiting for five seconds
+            # check whether SOAP server is reachable.
             for i in range(1, 5):
                 sys.stdout.write("*")
                 sys.stdout.flush()
@@ -182,7 +184,7 @@ class StartBuildAction(InitVMAction):
             have_session = os.system(
                 "tmux has-session -t ElbeInitVMSession >/dev/null 2>&1")
         except CommandError as e:
-            print("tmux execution failed, tmux version 1.9 or higher is required")
+            print("tmux exec failed, tmux version 1.9 or higher is required")
             sys.exit(20)
         if have_session != 256:
             print("ElbeInitVMSession already exists in tmux.", file=sys.stderr)
@@ -191,9 +193,8 @@ class StartBuildAction(InitVMAction):
                 file=sys.stderr)
             sys.exit(20)
 
-        system(
-            'TMUX= tmux new-session -d -s ElbeInitVMSession -n initvm "cd \"%s\"; make"' %
-            initvmdir)
+        system('TMUX= tmux new-session -d -s ElbeInitVMSession -n initvm '
+               '"cd \"%s\"; make"' % initvmdir)
 
 
 InitVMAction.register(StartBuildAction)
@@ -209,14 +210,16 @@ class CreateAction(InitVMAction):
     def execute(self, initvmdir, opt, args):
         if self.initvm is not None:
             print("Initvm already defined.\n")
-            print(
-                "If you want to build in your old initvm, use `elbe initvm submit <xml>`.")
-            print(
-                "If you want to remove your old initvm from libvirt run `virsh undefine initvm`.\n")
+            print("If you want to build in your old initvm, "
+                  "use `elbe initvm submit <xml>`.")
+            print("If you want to remove your old initvm from libvirt "
+                  "run `virsh undefine initvm`.\n")
             print("Note:")
-            print("\t1) You can reimport your old initvm via `virsh define <file>`")
+            print("\t1) You can reimport your old initvm via "
+                  "`virsh define <file>`")
             print("\t   where <file> is the corresponding libvirt.xml")
-            print("\t2) virsh undefine does not delete the image of your old initvm.")
+            print("\t2) virsh undefine does not delete the image "
+                  "of your old initvm.")
             sys.exit(20)
 
         # Init cdrom to None, if we detect it, we set it
@@ -360,8 +363,8 @@ class CreateAction(InitVMAction):
                     print("XML file is inavlid: %s" % str(e))
                     sys.exit(20)
                 if not x.has('project'):
-                    print(
-                        "elbe initvm ready: use 'elbe initvm submit myproject.xml' to build a project")
+                    print("elbe initvm ready: use 'elbe initvm submit "
+                          "myproject.xml' to build a project")
                     sys.exit(0)
 
                 ret, prjdir, err = command_out_stderr(
diff --git a/elbepack/pbuilder.py b/elbepack/pbuilder.py
index ce3e27db..e31c61c0 100644
--- a/elbepack/pbuilder.py
+++ b/elbepack/pbuilder.py
@@ -42,14 +42,11 @@ def pbuilder_write_config(builddir, xml, log):
     fp.write('PATH="/usr/share/elbe/qemu-elbe:$PATH"\n')
 
     if (xml.text("project/arch", key="arch") != 'amd64'):
-        fp.write(
-            'ARCHITECTURE="%s"\n' %
-            xml.text(
-                "project/buildimage/arch",
-                key="arch"))
+        fp.write('ARCHITECTURE="%s"\n' %
+                 xml.text("project/buildimage/arch", key="arch"))
         fp.write('DEBOOTSTRAP="qemu-debootstrap"\n')
-        fp.write(
-            'DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--arch=$ARCHITECTURE")\n')
+        fp.write('DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" '
+                 '"--arch=$ARCHITECTURE")\n')
 
     if xml.prj.has('noauth'):
         fp.write(
@@ -59,8 +56,8 @@ def pbuilder_write_config(builddir, xml, log):
     # aptitude segfaults with sid armhf changeroots, great! :)
     # link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834990
     if distname == 'stretch':
-        fp.write(
-            'PBUILDERSATISFYDEPENDSCMD=/usr/lib/pbuilder/pbuilder-satisfydepends-experimental\n')
+        fp.write('PBUILDERSATISFYDEPENDSCMD='
+                 '/usr/lib/pbuilder/pbuilder-satisfydepends-experimental\n')
 
     fp.close()
 
@@ -126,21 +123,21 @@ def pbuilder_write_repo_hook(builddir, xml):
         '/repo/repo.pub')
 
     if xml.prj.has("mirror/primary_host"):
-        mirror += 'echo "deb ' + xml.get_primary_mirror(None) + ' ' + xml.prj.text(
-            "suite") + ' main" >> /etc/apt/sources.list\n'
+        mirror += 'echo "deb ' + xml.get_primary_mirror(None) + ' ' + \
+                  xml.prj.text("suite") + ' main" >> /etc/apt/sources.list\n'
 
         if xml.prj.has("mirror/url-list"):
             for url in xml.prj.node("mirror/url-list"):
                 if url.has("binary"):
-                    mirror += 'echo "deb ' + \
-                        url.text("binary").strip() + '" >> /etc/apt/sources.list\n'
+                    mirror += 'echo "deb ' + url.text("binary").strip() + \
+                              '" >> /etc/apt/sources.list\n'
                 if url.has("key"):
                     key_url = url.text("key").strip()
                     mirror = mirror_script_add_key(mirror, key_url)
 
     if xml.prj.has("mirror/cdrom"):
-        mirror += 'echo "deb copy:///cdrom/targetrepo %s main added" >> /etc/apt/sources.list' % (
-            xml.prj.text("suite"))
+        mirror += 'echo "deb copy:///cdrom/targetrepo %s main added" >> ' \
+                  '/etc/apt/sources.list' % (xml.prj.text("suite"))
 
     mirror += 'apt-get update\n'
     mirror = mirror.replace("LOCALMACHINE", "10.0.2.2")
diff --git a/elbepack/pkgarchive.py b/elbepack/pkgarchive.py
index e94eb746..ee0c2bbc 100644
--- a/elbepack/pkgarchive.py
+++ b/elbepack/pkgarchive.py
@@ -107,8 +107,8 @@ def checkout_binpkg_archive(ep, repodir):
 
     with ep.buildenv:
         try:
-            # Copy the package archive into the buildenv, so the RPCAptCache can
-            # access it
+            # Copy the package archive into the buildenv,
+            # so the RPCAptCache can access it
             ep.log.printo("Copying package archive into build environment")
             copytree(repopath, pkgarchive)
 
diff --git a/elbepack/pkgutils.py b/elbepack/pkgutils.py
index 4b83f8e6..2e7eaf0a 100644
--- a/elbepack/pkgutils.py
+++ b/elbepack/pkgutils.py
@@ -25,10 +25,11 @@ try:
     from apt_pkg import TagFile
     virtapt_imported = True
 except ImportError:
-    print("WARNING - python-apt not available: if there are multiple versions of")
-    print(" elbe-bootstrap packages on the mirror(s) elbe selects the first package it")
-    print(" has found. There is no guarantee that the latest package is used.")
-    print(" To ensure this, the python-apt package needs to be installed.")
+    print("WARNING - python-apt not available:")
+    print("If there are multiple versions of elbe-bootstrap packages on the "
+          "mirror(s) elbe selects the first package it has found.")
+    print("There is no guarantee that the latest package is used.")
+    print("To ensure this, the python-apt package needs to be installed.")
     virtapt_imported = False
 
 
diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index f039da9c..8b257854 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -16,7 +16,8 @@ from elbepack.asyncworker import AsyncWorker, BuildJob, APTUpdateJob
 from elbepack.asyncworker import APTCommitJob, GenUpdateJob
 from elbepack.asyncworker import SaveVersionJob, CheckoutVersionJob
 from elbepack.asyncworker import APTUpdUpgrJob, BuildSysrootJob
-from elbepack.asyncworker import PdebuildJob, CreatePbuilderJob, UpdatePbuilderJob
+from elbepack.asyncworker import (PdebuildJob, CreatePbuilderJob,
+                                  UpdatePbuilderJob)
 from elbepack.asyncworker import BuildChrootTarJob
 from elbepack.elbexml import ValidationMode
 
@@ -309,9 +310,8 @@ class ProjectManager(object):
         with self.lock:
             ep = self._get_current_project(userid, allow_busy=False)
             if not path.isdir(path.join(ep.builddir, "pbuilder")):
-                raise InvalidState(
-                    'No pbuilder exists: run "elbe pbuilder create --project %s" first' %
-                    ep.builddir)
+                raise InvalidState('No pbuilder exists: run "elbe pbuilder '
+                                   'create --project %s" first' % ep.builddir)
 
             self.worker.enqueue(PdebuildJob(ep))
 
@@ -319,9 +319,8 @@ class ProjectManager(object):
         with self.lock:
             ep = self._get_current_project(userid, allow_busy=False)
             if not path.isdir(path.join(ep.builddir, "pbuilder")):
-                raise InvalidState(
-                    'No pbuilder exists: run "elbe pbuilder create --project %s" first' %
-                    ep.builddir)
+                raise InvalidState('No pbuilder exists: run "elbe pbuilder '
+                                   'create --project %s" first' % ep.builddir)
 
             ep.orig_fname = fname
             ep.orig_files.append(fname)
@@ -330,9 +329,8 @@ class ProjectManager(object):
         with self.lock:
             ep = self._get_current_project(userid, allow_busy=False)
             if not path.isdir(path.join(ep.builddir, "pbuilder")):
-                raise InvalidState(
-                    'No pbuilder exists: run "elbe pbuilder create --project %s" first' %
-                    ep.builddir)
+                raise InvalidState('No pbuilder exists: run "elbe pbuilder '
+                                   'create --project %s" first' % ep.builddir)
 
             return ep.orig_fname
 
@@ -559,9 +557,9 @@ class ProjectManager(object):
         if userid in self.userid2project:
             builddir = self.userid2project[userid].builddir
             if self.db.is_busy(builddir):
-                raise InvalidState(
-                    "project in directory %s of user %s is currently busy and cannot be closed" %
-                    (builddir, self.db.get_username(userid)))
+                raise InvalidState("project in directory %s of user %s is "
+                                   "currently busy and cannot be closed" %
+                                   (builddir, self.db.get_username(userid)))
 
             del self.builddir2userid[builddir]
             del self.userid2project[userid]
diff --git a/elbepack/repomanager.py b/elbepack/repomanager.py
index c3f6cda3..83143496 100644
--- a/elbepack/repomanager.py
+++ b/elbepack/repomanager.py
@@ -110,12 +110,10 @@ class RepoBase(object):
             fp.write("Suite: " + codename2suite[att.codename] + "\n")
             fp.write("Codename: " + att.codename + "\n")
             fp.write("Architectures: " + " ".join(att.arch) + "\n")
-            fp.write("Components: " +
-                     " ".join(att.components.difference(set(["main/debian-installer"]))) +
-                     "\n")
-            fp.write("UDebComponents: " +
-                     " ".join(att.components.difference(set(["main/debian-installer"]))) +
-                     "\n")
+            fp.write("Components: " + " ".join(att.components.difference(
+                set(["main/debian-installer"]))) + "\n")
+            fp.write("UDebComponents: " + " ".join(att.components.difference(
+                set(["main/debian-installer"]))) + "\n")
             fp.write("Description: " + self.description + "\n")
             fp.write("SignWith: " + self.keyid + "\n")
 
@@ -213,15 +211,11 @@ class RepoBase(object):
         self._includedeb(path, self.init_attr.codename, component)
 
     def _include(self, path, codename, component):
-        self.log.do(
-            'reprepro --ignore=wrongdistribution --ignore=surprisingbinary --keepunreferencedfiles --export=never --basedir "' +
-            self.fs.path +
-            '" -C ' +
-            component +
-            ' -P normal -S misc include ' +
-            codename +
-            ' ' +
-            path)
+        self.log.do('reprepro --ignore=wrongdistribution '
+                    '--ignore=surprisingbinary --keepunreferencedfiles '
+                    '--export=never --basedir "' + self.fs.path + '" -C ' +
+                    component + ' -P normal -S misc include ' + codename +
+                    ' ' + path)
 
     def _removedeb(self, pkgname, codename, component):
         self.log.do(
diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index 1afe96a9..39157f01 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -8,7 +8,8 @@ import urlparse
 import urllib2
 
 from elbepack.efilesystem import BuildImgFs
-from elbepack.templates import write_pack_template, get_preseed, preseed_to_text
+from elbepack.templates import (write_pack_template, get_preseed,
+                                preseed_to_text)
 from elbepack.shellhelper import CommandError
 
 
@@ -63,12 +64,12 @@ class BuildEnv ():
     def __enter__(self):
         if os.path.exists(self.path + '/../repo/pool'):
             self.log.do("mv %s/../repo %s" % (self.path, self.path))
-            self.log.do(
-                'echo "deb copy:///repo %s main" > %s/etc/apt/sources.list.d/local.list' %
-                (self.xml.text("project/suite"), self.path))
-            self.log.do(
-                'echo "deb-src copy:///repo %s main" >> %s/etc/apt/sources.list.d/local.list' %
-                (self.xml.text("project/suite"), self.path))
+            self.log.do('echo "deb copy:///repo %s main" > '
+                        '%s/etc/apt/sources.list.d/local.list' % (
+                            self.xml.text("project/suite"), self.path))
+            self.log.do('echo "deb-src copy:///repo %s main" >> '
+                        '%s/etc/apt/sources.list.d/local.list' % (
+                            self.xml.text("project/suite"), self.path))
         self.cdrom_mount()
         self.rfs.__enter__()
         return self
@@ -90,8 +91,8 @@ class BuildEnv ():
 
         if self.xml.prj.has("mirror/primary_proxy"):
             os.environ["no_proxy"] = "10.0.2.2,localhost,127.0.0.1"
-            proxy = self.xml.prj.text(
-                "mirror/primary_proxy").strip().replace("LOCALMACHINE", "localhost")
+            proxy = self.xml.prj.text("mirror/primary_proxy")
+            proxy = proxy.strip().replace("LOCALMACHINE", "localhost")
             os.environ["http_proxy"] = proxy
             os.environ["https_proxy"] = proxy
         else:
@@ -138,8 +139,9 @@ class BuildEnv ():
             return
 
         if self.xml.has("project/noauth"):
-            cmd = 'debootstrap --no-check-gpg --foreign --arch=%s "%s" "%s" "%s"' % (
-                arch, suite, self.rfs.path, primary_mirror)
+            cmd = 'debootstrap --no-check-gpg --foreign ' \
+                  '--arch=%s "%s" "%s" "%s"' % (arch, suite, self.rfs.path,
+                                                primary_mirror)
         else:
             if self.xml.has("project/mirror/cdrom"):
                 keyring = ' --keyring="%s/targetrepo/elbe-keyring.gpg"' % (
@@ -268,17 +270,17 @@ class BuildEnv ():
 
         self.log.chroot(
             self.rfs.path,
-            """/bin/sh -c 'echo "127.0.0.1 %s.%s %s elbe-daemon" >> /etc/hosts'""" %
-            (hostname,
-             domain,
-             hostname))
+            """/bin/sh -c 'echo "127.0.0.1 %s.%s %s elbe-daemon" >> """
+            """/etc/hosts'""" % (hostname, domain, hostname))
+
         self.log.chroot(
             self.rfs.path,
-            """/bin/sh -c 'echo "%s" > /etc/hostname'""" %
-            hostname)
+            """/bin/sh -c 'echo "%s" > /etc/hostname'""" % hostname)
+
         self.log.chroot(
-            self.rfs.path, """/bin/sh -c 'echo "%s.%s" > /etc/mailname'""" %
-            (hostname, domain))
+            self.rfs.path,
+            """/bin/sh -c 'echo "%s.%s" > """
+            """/etc/mailname'""" % (hostname, domain))
 
         if self.xml.has("target/console"):
             serial_con, serial_baud = self.xml.text(
@@ -286,15 +288,19 @@ class BuildEnv ():
             if serial_baud:
                 self.log.chroot(
                     self.rfs.path,
-                    """/bin/sh -c '[ -f /etc/inittab ] && echo "T0:23:respawn:/sbin/getty -L %s %s vt100" >> /etc/inittab'""" %
-                    (serial_con,
-                     serial_baud),
+                    """/bin/sh -c '[ -f /etc/inittab ] && """
+                    """echo "T0:23:respawn:/sbin/getty -L %s %s vt100" >> """
+                    """/etc/inittab'""" % (serial_con, serial_baud),
                     allow_fail=True)
+
                 self.log.chroot(
                     self.rfs.path,
-                    """/bin/sh -c '[ -f /lib/systemd/system/serial-getty at .service ] && ln -s /lib/systemd/system/serial-getty at .service /etc/systemd/system/getty.target.wants/serial-getty@%s.service'""" %
-                    serial_con,
+                    """/bin/sh -c """
+                    """'[ -f /lib/systemd/system/serial-getty at .service ] && """
+                    """ln -s /lib/systemd/system/serial-getty at .service """
+                    """/etc/systemd/system/getty.target.wants/"""
+                    """serial-getty@%s.service'""" % serial_con,
                     allow_fail=True)
             else:
-                self.log.printo(
-                    "parsing console tag failed, needs to be of '/dev/ttyS0,115200' format.")
+                self.log.printo("parsing console tag failed, needs to be of "
+                                "'/dev/ttyS0,115200' format.")
diff --git a/elbepack/rpcaptcache.py b/elbepack/rpcaptcache.py
index 9cd50d0c..a9a8133e 100644
--- a/elbepack/rpcaptcache.py
+++ b/elbepack/rpcaptcache.py
@@ -7,7 +7,8 @@ from multiprocessing.util import Finalize
 from apt_pkg import config, version_compare
 from apt import Cache
 from multiprocessing.managers import BaseManager
-from elbepack.aptprogress import ElbeAcquireProgress, ElbeInstallProgress, ElbeOpProgress
+from elbepack.aptprogress import (ElbeAcquireProgress, ElbeInstallProgress,
+                                  ElbeOpProgress)
 from elbepack.aptpkgutils import getalldeps, APTPackage
 
 import os
@@ -111,13 +112,15 @@ class RPCAPTCache(InChRootObject):
         # list all debian src packages of all installed packages that don't
         # come from debootstrap
         src_list = [
-            p.candidate.source_name for p in self.cache if p.is_installed and p.name not in ignore_pkgs]
+            p.candidate.source_name for p in self.cache if (
+                p.is_installed and p.name not in ignore_pkgs)]
         # go through all packages, remember package if its source package
         # matches one of the installed packages and the binary package is a
         # '-dev' package
         dev_list = [
             s for s in self.cache if (
-                s.candidate.source_name in src_list and s.name.endswith('-dev'))]
+                s.candidate.source_name in src_list and (
+                    s.name.endswith('-dev')))]
         for p in dev_list:
             if p.name not in ignore_dev_pkgs:
                 p.mark_install()
@@ -130,13 +133,15 @@ class RPCAPTCache(InChRootObject):
 
     def cleanup(self, exclude_pkgs):
         for p in self.cache:
-            if (p.is_installed and not p.is_auto_installed) or p.is_auto_removable:
-                remove = True
-                for x in exclude_pkgs:
-                    if x == p.name:
-                        remove = False
-                if remove:
-                    p.mark_delete(auto_fix=True, purge=True)
+            if p.is_installed and not \
+               p.is_auto_installed or \
+               p.is_auto_removable:
+                    remove = True
+                    for x in exclude_pkgs:
+                        if x == p.name:
+                            remove = False
+                    if remove:
+                        p.mark_delete(auto_fix=True, purge=True)
 
     def mark_upgrade(self, pkgname, version):
         p = self.cache[pkgname]
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index 041923e8..e272ec09 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -11,7 +11,7 @@ import time
 import sys
 import os
 import fnmatch
-import deb822                     # package for dealing with Debian related data
+import deb822   # package for dealing with Debian related data
 
 from suds.client import Client
 from datetime import datetime
@@ -617,9 +617,8 @@ class SetPdebuilderAction(ClientAction):
         size = 1024 * 1024
 
         if len(args) != 2:
-            print(
-                "usage: elbe control set_pdebuild <project_dir> <pdebuild file>",
-                file=sys.stderr)
+            print("usage: elbe control set_pdebuild "
+                  "<project_dir> <pdebuild file>", file=sys.stderr)
             sys.exit(20)
 
         builddir = args[0]
@@ -730,7 +729,8 @@ class DownloadAction(RepoAction):
 
     def execute(self, client, opt, args):
         if len(args) != 1:
-            print("usage: elbe prjrepo download <project_dir>", file=sys.stderr)
+            print("usage: elbe prjrepo download <project_dir>",
+                  file=sys.stderr)
             sys.exit(20)
 
         builddir = args[0]
diff --git a/elbepack/toolchain.py b/elbepack/toolchain.py
index 4095d132..05d0409a 100644
--- a/elbepack/toolchain.py
+++ b/elbepack/toolchain.py
@@ -50,7 +50,9 @@ class LinaroToolchain(Toolchain):
                 "libstdc++6": ["libstdc++.so.*"]}
 
     pkg_deps = {
-        "libasan0": "libc6 (>= 2.13-28), libstdc++ (>= 4.8.3), libgcc1 (>= 4.8.3)",
+        "libasan0": "libc6 (>= 2.13-28), "
+                    "libstdc++ (>= 4.8.3), "
+                    "libgcc1 (>= 4.8.3)",
         "libatomic1": "libc6 (>= 2.13-28)",
         "libgcc1": "libc6 (>= 2.13-28)",
         "libgfortran3": "libgcc1 (>= 4.8.3)",
diff --git a/elbepack/validate.py b/elbepack/validate.py
index ea53fd22..91c64879 100644
--- a/elbepack/validate.py
+++ b/elbepack/validate.py
@@ -35,7 +35,7 @@ def validate_xml(fname):
             uses_xinclude = True
 
     if uses_xinclude:
-        errors.append(
-            "\nThere are XIncludes in the XML file. Run 'elbe preprocess' first!\n")
+        errors.append("\nThere are XIncludes in the XML file. "
+                      "Run 'elbe preprocess' first!\n")
 
     return errors
diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 5963a86b..9fa5f7f1 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -111,13 +111,15 @@ class VirtApt:
         ring_path = self.projectpath + "/etc/apt/trusted.gpg"
         if not os.path.isdir("/etc/apt/trusted.gpg.d"):
             print("/etc/apt/trusted.gpg.d doesn't exist")
-            print("apt-get install debian-archive-keyring may fix this problem")
+            print("apt-get install debian-archive-keyring may "
+                  "fix this problem")
             sys.exit(20)
 
         system('cp /etc/apt/trusted.gpg "%s"' % ring_path)
 
-        gpg_options = '--keyring "%s" --no-auto-check-trustdb --trust-model always --no-default-keyring --homedir "%s"' % (
-            ring_path, self.projectpath)
+        gpg_options = '--keyring "%s" --no-auto-check-trustdb ' \
+                      '--trust-model always --no-default-keyring ' \
+                      '--homedir "%s"' % (ring_path, self.projectpath)
 
         system('gpg %s --import "%s"' % (
             gpg_options,
@@ -136,8 +138,10 @@ class VirtApt:
     def add_pubkey_url(self, url):
         ring_path = self.projectpath + "/etc/apt/trusted.gpg"
         tmpkey_path = self.projectpath + "/tmpkey.gpg"
-        gpg_options = '--keyring "%s" --no-auto-check-trustdb --trust-model always --no-default-keyring --homedir "%s"' % (
-            ring_path, self.projectpath)
+
+        gpg_options = '--keyring "%s" --no-auto-check-trustdb ' \
+                      '--trust-model always --no-default-keyring ' \
+                      '--homedir "%s"' % (ring_path, self.projectpath)
 
         try:
             system('wget -O "%s" "%s"' % (tmpkey_path, url))
diff --git a/setup.py b/setup.py
index 413a0150..e1c29e56 100644
--- a/setup.py
+++ b/setup.py
@@ -29,8 +29,9 @@ class my_install(install):
     def run(self):
         install.run(self)
         if self.root:
-            envvars = dict(
-                {"prefix": self.prefix, "DESTDIR": self.root}, **dict(os.environ))
+            envvars = dict({"prefix": self.prefix,
+                            "DESTDIR": self.root},
+                           **dict(os.environ))
         else:
             envvars = dict({"prefix": self.prefix}, **dict(os.environ))
 
@@ -68,12 +69,16 @@ setup(name='elbe',
       scripts=['elbe'],
       cmdclass={"install": my_install},
       data_files=[
-          ('/usr/share/doc/elbe-doc/', glob.glob("docs/elbe-schema-reference*")),
-          ('/usr/share/doc/elbe-doc/', glob.glob("docs/elbeoverview-en*")),
-          ('/usr/share/doc/elbe-doc/contrib/linux', glob.glob("contrib/linux/*")),
-          ('/usr/share/doc/elbe-doc/examples', glob.glob("examples/*xml")),
+          ('/usr/share/doc/elbe-doc/',
+           glob.glob("docs/elbe-schema-reference*")),
+          ('/usr/share/doc/elbe-doc/',
+           glob.glob("docs/elbeoverview-en*")),
+          ('/usr/share/doc/elbe-doc/contrib/linux',
+           glob.glob("contrib/linux/*")),
+          ('/usr/share/doc/elbe-doc/examples',
+           glob.glob("examples/*xml")),
           ('/usr/share/doc/elbe-doc/examples/includes/prod',
-              glob.glob("examples/includes/prod/*.xml")),
+           glob.glob("examples/includes/prod/*.xml")),
           ('/usr/share/doc/elbe-doc/examples/includes/devel',
-              glob.glob("examples/includes/devel/*.xml"))],
+           glob.glob("examples/includes/devel/*.xml"))],
       )
-- 
2.15.1




More information about the elbe-devel mailing list