[elbe-devel] [PATCH 14/25] pylint: annotate functions triggerring too-many-* messages

Torben Hohn torben.hohn at linutronix.de
Wed Aug 22 10:42:15 CEST 2018


"pylint -f parseable -d all -e R0911,R0912,R0913,R0914,R0915 elbepack" complains:

---------------------------------------------------------------------------------------------------------------------------
************* Module elbepack.cdroms
elbepack/cdroms.py:25: [R0913(too-many-arguments), mk_source_cdrom] Too many arguments (8/5)
elbepack/cdroms.py:25: [R0914(too-many-locals), mk_source_cdrom] Too many local variables (18/15)
elbepack/cdroms.py:123: [R0913(too-many-arguments), mk_binary_cdrom] Too many arguments (8/5)
elbepack/cdroms.py:123: [R0914(too-many-locals), mk_binary_cdrom] Too many local variables (22/15)
elbepack/cdroms.py:123: [R0912(too-many-branches), mk_binary_cdrom] Too many branches (13/12)
elbepack/cdroms.py:123: [R0915(too-many-statements), mk_binary_cdrom] Too many statements (72/50)
************* Module elbepack.elbeproject
elbepack/elbeproject.py:105: [R0913(too-many-arguments), ElbeProject.__init__] Too many arguments (14/5)
elbepack/elbeproject.py:406: [R0913(too-many-arguments), ElbeProject.build] Too many arguments (8/5)
elbepack/elbeproject.py:406: [R0914(too-many-locals), ElbeProject.build] Too many local variables (17/15)
elbepack/elbeproject.py:406: [R0915(too-many-statements), ElbeProject.build] Too many statements (88/50)
elbepack/elbeproject.py:782: [R0915(too-many-statements), ElbeProject.install_packages] Too many statements (54/50)
************* Module elbepack.initvmaction
elbepack/initvmaction.py:253: [R0914(too-many-locals), CreateAction.execute] Too many local variables (20/15)
elbepack/initvmaction.py:253: [R0912(too-many-branches), CreateAction.execute] Too many branches (15/12)
elbepack/initvmaction.py:253: [R0915(too-many-statements), CreateAction.execute] Too many statements (185/50)
elbepack/initvmaction.py:549: [R0914(too-many-locals), SubmitAction.execute] Too many local variables (17/15)
elbepack/initvmaction.py:549: [R0915(too-many-statements), SubmitAction.execute] Too many statements (135/50)
************* Module elbepack.finetuning
elbepack/finetuning.py:386: [R0914(too-many-locals), UpdatedAction.execute] Too many local variables (17/15)
************* Module elbepack.rpcaptcache
elbepack/rpcaptcache.py:31: [R0913(too-many-arguments), RPCAPTCache.__init__] Too many arguments (7/5)
elbepack/rpcaptcache.py:269: [R0913(too-many-arguments), get_rpcaptcache] Too many arguments (6/5)
************* Module elbepack.updated
elbepack/updated.py:248: [R0914(too-many-locals), _apply_update] Too many local variables (17/15)
elbepack/updated.py:426: [R0914(too-many-locals), action_select] Too many local variables (16/15)
elbepack/updated.py:426: [R0911(too-many-return-statements), action_select] Too many return statements (7/6)
elbepack/updated.py:426: [R0912(too-many-branches), action_select] Too many branches (17/12)
elbepack/updated.py:426: [R0915(too-many-statements), action_select] Too many statements (85/50)
************* Module elbepack.repomanager
elbepack/repomanager.py:57: [R0913(too-many-arguments), RepoBase.__init__] Too many arguments (8/5)
elbepack/repomanager.py:335: [R0913(too-many-arguments), CdromInitRepo.__init__] Too many arguments (7/5)
elbepack/repomanager.py:353: [R0913(too-many-arguments), CdromBinRepo.__init__] Too many arguments (8/5)
elbepack/repomanager.py:382: [R0913(too-many-arguments), CdromSrcRepo.__init__] Too many arguments (7/5)
************* Module elbepack.pkgutils
elbepack/pkgutils.py:93: [R0914(too-many-locals), get_url] Too many local variables (16/15)
elbepack/pkgutils.py:199: [R0913(too-many-arguments), download_pkg] Too many arguments (7/5)
elbepack/pkgutils.py:199: [R0914(too-many-locals), download_pkg] Too many local variables (17/15)
elbepack/pkgutils.py:255: [R0913(too-many-arguments), extract_pkg] Too many arguments (7/5)
************* Module elbepack.efilesystem
elbepack/efilesystem.py:43: [R0914(too-many-locals), extract_target] Too many local variables (19/15)
************* Module elbepack.asyncworker
elbepack/asyncworker.py:149: [R0915(too-many-statements), BuildJob.execute] Too many statements (60/50)
************* Module elbepack.soapclient
elbepack/soapclient.py:46: [R0913(too-many-arguments), ElbeSoapClient.__init__] Too many arguments (7/5)
************* Module elbepack.hdimg
elbepack/hdimg.py:358: [R0913(too-many-arguments), create_partition] Too many arguments (6/5)
elbepack/hdimg.py:397: [R0913(too-many-arguments), create_label] Too many arguments (7/5)
elbepack/hdimg.py:434: [R0913(too-many-arguments), create_logical_partitions] Too many arguments (7/5)
elbepack/hdimg.py:464: [R0913(too-many-arguments), do_image_hd] Too many arguments (6/5)
elbepack/hdimg.py:464: [R0914(too-many-locals), do_image_hd] Too many local variables (17/15)
elbepack/hdimg.py:562: [R0913(too-many-arguments), do_hdimg] Too many arguments (6/5)
elbepack/hdimg.py:562: [R0914(too-many-locals), do_hdimg] Too many local variables (19/15)
************* Module elbepack.fstab
elbepack/fstab.py:107: [R0911(too-many-return-statements), fstabentry.get_label_opt] Too many return statements (7/6)
************* Module elbepack.updatepkg
elbepack/updatepkg.py:34: [R0913(too-many-arguments), gen_update_pkg] Too many arguments (8/5)
elbepack/updatepkg.py:34: [R0914(too-many-locals), gen_update_pkg] Too many local variables (27/15)
elbepack/updatepkg.py:34: [R0915(too-many-statements), gen_update_pkg] Too many statements (68/50)
************* Module elbepack.elbexml
elbepack/elbexml.py:183: [R0914(too-many-locals), ElbeXML.validate_apt_sources] Too many local variables (21/15)
************* Module elbepack.pbuilderaction
elbepack/pbuilderaction.py:160: [R0915(too-many-statements), BuildAction.execute] Too many statements (102/50)
************* Module elbepack.rfs
elbepack/rfs.py:26: [R0913(too-many-arguments), BuildEnv.__init__] Too many arguments (6/5)
elbepack/rfs.py:88: [R0915(too-many-statements), BuildEnv.debootstrap] Too many statements (61/50)
************* Module elbepack.dump
elbepack/dump.py:82: [R0915(too-many-statements), check_full_pkgs] Too many statements (52/50)
elbepack/dump.py:164: [R0913(too-many-arguments), elbe_report] Too many arguments (6/5)
elbepack/dump.py:164: [R0914(too-many-locals), elbe_report] Too many local variables (25/15)
elbepack/dump.py:164: [R0915(too-many-statements), elbe_report] Too many statements (93/50)
************* Module elbepack.virtapt
elbepack/virtapt.py:75: [R0913(too-many-arguments), VirtApt.__init__] Too many arguments (7/5)
************* Module elbepack.licencexml
elbepack/licencexml.py:50: [R0914(too-many-locals), copyright_xml.add_copyright_file] Too many local variables (21/15)
************* Module elbepack.aptpkgutils
elbepack/aptpkgutils.py:76: [R0913(too-many-arguments), PackageBase.__init__] Too many arguments (10/5)
************* Module elbepack.xmlpreprocess
elbepack/xmlpreprocess.py:24: [R0914(too-many-locals), xmlpreprocess] Too many local variables (18/15)
************* Module elbepack.debpkg
elbepack/debpkg.py:43: [R0913(too-many-arguments), build_binary_deb] Too many arguments (7/5)
************* Module elbepack.db
elbepack/db.py:865: [R0913(too-many-arguments), ElbeDB._update_project_file] Too many arguments (6/5)
elbepack/db.py:890: [R0913(too-many-arguments), ElbeDB.add_user] Too many arguments (6/5)
elbepack/db.py:909: [R0913(too-many-arguments), ElbeDB.modify_user] Too many arguments (7/5)
elbepack/db.py:1009: [R0913(too-many-arguments), ElbeDB.init_db] Too many arguments (6/5)
************* Module elbepack.pkgarchive
elbepack/pkgarchive.py:15: [R0913(too-many-arguments), ArchiveRepo.__init__] Too many arguments (8/5)
elbepack/pkgarchive.py:101: [R0914(too-many-locals), checkout_binpkg_archive] Too many local variables (18/15)
elbepack/pkgarchive.py:101: [R0915(too-many-statements), checkout_binpkg_archive] Too many statements (58/50)
************* Module elbepack.commands.prjrepo
elbepack/commands/prjrepo.py:23: [R0915(too-many-statements), run_command] Too many statements (62/50)
************* Module elbepack.commands.parselicence
elbepack/commands/parselicence.py:127: [R0914(too-many-locals), run_command] Too many local variables (23/15)
elbepack/commands/parselicence.py:127: [R0915(too-many-statements), run_command] Too many statements (92/50)
************* Module elbepack.commands.init
elbepack/commands/init.py:26: [R0914(too-many-locals), run_command] Too many local variables (20/15)
elbepack/commands/init.py:26: [R0915(too-many-statements), run_command] Too many statements (93/50)
************* Module elbepack.commands.gen_update
elbepack/commands/gen_update.py:20: [R0915(too-many-statements), run_command] Too many statements (55/50)
************* Module elbepack.commands.check_updates
elbepack/commands/check_updates.py:21: [R0914(too-many-locals), run_command] Too many local variables (24/15)
elbepack/commands/check_updates.py:21: [R0915(too-many-statements), run_command] Too many statements (63/50)
************* Module elbepack.commands.pkgdiff
elbepack/commands/pkgdiff.py:21: [R0914(too-many-locals), run_command] Too many local variables (16/15)
************* Module elbepack.commands.control
elbepack/commands/control.py:25: [R0915(too-many-statements), run_command] Too many statements (70/50)
************* Module elbepack.commands.mkcdrom
elbepack/commands/mkcdrom.py:23: [R0915(too-many-statements), run_command] Too many statements (52/50)
************* Module elbepack.daemons.soap.faults
elbepack/daemons/soap/faults.py:177: [R0913(too-many-arguments), soap_faults.wrapped] Too many arguments (6/5)
elbepack/daemons/soap/faults.py:197: [R0913(too-many-arguments), soap_faults.wrapped] Too many arguments (7/5)
elbepack/daemons/soap/faults.py:71: [R0911(too-many-return-statements), soap_faults] Too many return statements (7/6)
************* Module elbepack.daemons.soap.authentication
elbepack/daemons/soap/authentication.py:79: [R0913(too-many-arguments), authenticated_uid.wrapped] Too many arguments (6/5)
elbepack/daemons/soap/authentication.py:146: [R0913(too-many-arguments), authenticated_admin.wrapped] Too many arguments (6/5)
************* Module elbepack.daemons.soap.esoap
elbepack/daemons/soap/esoap.py:64: [R0913(too-many-arguments), ESoap.add_user] Too many arguments (6/5)
elbepack/daemons/soap/esoap.py:83: [R0913(too-many-arguments), ESoap.upload_file] Too many arguments (6/5)
elbepack/daemons/soap/esoap.py:165: [R0913(too-many-arguments), ESoap.build] Too many arguments (6/5)
---------------------------------------------------------------------------------------------------------------------------

annotate most of these functions with "pylint: disable=too-many-xxxx"
new code shall not trigger these, but refactoring old code is delayed
for now.

After this patch "pylint -f parseable -d all -e R0911,R0912,R0913,R0914,R0915 elbepack":

---------------------------------------------------------------------------------------------------------------------------
************* Module elbepack.fstab
elbepack/fstab.py:107: [R0911(too-many-return-statements), fstabentry.get_label_opt] Too many return statements (7/6)
************* Module elbepack.elbexml
elbepack/elbexml.py:183: [R0914(too-many-locals), ElbeXML.validate_apt_sources] Too many local variables (21/15)
************* Module elbepack.daemons.soap.faults
elbepack/daemons/soap/faults.py:177: [R0913(too-many-arguments), soap_faults.wrapped] Too many arguments (6/5)
elbepack/daemons/soap/faults.py:197: [R0913(too-many-arguments), soap_faults.wrapped] Too many arguments (7/5)
elbepack/daemons/soap/faults.py:71: [R0911(too-many-return-statements), soap_faults] Too many return statements (7/6)
************* Module elbepack.daemons.soap.authentication
elbepack/daemons/soap/authentication.py:79: [R0913(too-many-arguments), authenticated_uid.wrapped] Too many arguments (6/5)
elbepack/daemons/soap/authentication.py:146: [R0913(too-many-arguments), authenticated_admin.wrapped] Too many arguments (6/5)
---------------------------------------------------------------------------------------------------------------------------

these can be fixed rather easily, and also point to bad/complicated
code.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/aptpkgutils.py            |  2 ++
 elbepack/asyncworker.py            |  3 +++
 elbepack/cdroms.py                 |  8 ++++++++
 elbepack/commands/check_updates.py |  3 +++
 elbepack/commands/control.py       |  3 +++
 elbepack/commands/gen_update.py    |  3 +++
 elbepack/commands/init.py          |  4 ++++
 elbepack/commands/mkcdrom.py       |  3 +++
 elbepack/commands/parselicence.py  |  4 ++++
 elbepack/commands/pkgdiff.py       |  2 ++
 elbepack/commands/prjrepo.py       |  3 +++
 elbepack/daemons/soap/esoap.py     |  9 +++++++++
 elbepack/db.py                     | 12 ++++++++++++
 elbepack/debpkg.py                 |  3 +++
 elbepack/dump.py                   |  8 ++++++++
 elbepack/efilesystem.py            |  3 +++
 elbepack/elbeproject.py            | 10 ++++++++++
 elbepack/elbexml.py                |  5 +++++
 elbepack/finetuning.py             |  2 ++
 elbepack/hdimg.py                  | 13 +++++++++++++
 elbepack/initvmaction.py           | 10 ++++++++++
 elbepack/licencexml.py             |  2 ++
 elbepack/pbuilderaction.py         |  3 +++
 elbepack/pkgarchive.py             |  6 ++++++
 elbepack/pkgutils.py               |  9 +++++++++
 elbepack/repomanager.py            |  8 ++++++++
 elbepack/rfs.py                    |  4 ++++
 elbepack/rpcaptcache.py            |  6 ++++++
 elbepack/soapclient.py             |  2 ++
 elbepack/updated.py                |  7 +++++++
 elbepack/updatepkg.py              |  4 ++++
 elbepack/virtapt.py                |  2 ++
 elbepack/xmlpreprocess.py          |  2 ++
 33 files changed, 168 insertions(+)

diff --git a/elbepack/aptpkgutils.py b/elbepack/aptpkgutils.py
index ba49853e..989d27fc 100644
--- a/elbepack/aptpkgutils.py
+++ b/elbepack/aptpkgutils.py
@@ -77,6 +77,8 @@ class PackageBase(object):
                  candidate_version, installed_md5, candidate_md5,
                  state, is_auto_installed, origin, architecture):
 
+        # pylint: disable=too-many-arguments
+
         self.name = name
         self.installed_version = installed_version
         self.candidate_version = candidate_version
diff --git a/elbepack/asyncworker.py b/elbepack/asyncworker.py
index 9f94df86..7f6173ba 100644
--- a/elbepack/asyncworker.py
+++ b/elbepack/asyncworker.py
@@ -147,6 +147,9 @@ class BuildJob(AsyncWorkerJob):
         AsyncWorkerJob.enqueue(self, queue, db)
 
     def execute(self, db):
+
+        # pylint: disable=too-many-statements
+
         try:
             self.project.log.printo("Build started")
             self.project.build(skip_pkglist=False,
diff --git a/elbepack/cdroms.py b/elbepack/cdroms.py
index a63e655d..9e2dffda 100644
--- a/elbepack/cdroms.py
+++ b/elbepack/cdroms.py
@@ -32,6 +32,10 @@ def mk_source_cdrom(
         cdrom_size=CDROM_SIZE,
         xml=None):
 
+    # pylint: disable=too-many-arguments
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-branches
+
     hostfs.mkdir_p('/var/cache/elbe/sources')
     rfs.mkdir_p('/var/cache/elbe/sources')
 
@@ -129,6 +133,10 @@ def mk_binary_cdrom(
         target,
         log,
         cdrom_size=CDROM_SIZE):
+    # pylint: disable=too-many-arguments
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-branches
+    # pylint: disable=too-many-statements
 
     rfs.mkdir_p('/var/cache/elbe/binaries/added')
     rfs.mkdir_p('/var/cache/elbe/binaries/main')
diff --git a/elbepack/commands/check_updates.py b/elbepack/commands/check_updates.py
index e250041d..153ea9a0 100644
--- a/elbepack/commands/check_updates.py
+++ b/elbepack/commands/check_updates.py
@@ -20,6 +20,9 @@ from elbepack.xmldefaults import ElbeDefaults
 
 def run_command(argv):
 
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-statements
+
     oparser = OptionParser(
         usage="usage: %prog check_updates [options] <source-xmlfile>")
     oparser.add_option(
diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index 90c4b6a3..b1d48eb8 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -23,6 +23,9 @@ from elbepack.elbexml import ValidationMode
 
 
 def run_command(argv):
+
+    # pylint: disable=too-many-statements
+
     oparser = OptionParser(usage="usage: elbe control [options] <command>")
 
     oparser.add_option("--host", dest="host", default=cfg['soaphost'],
diff --git a/elbepack/commands/gen_update.py b/elbepack/commands/gen_update.py
index b5f31bc6..37ee01c4 100644
--- a/elbepack/commands/gen_update.py
+++ b/elbepack/commands/gen_update.py
@@ -18,6 +18,9 @@ from elbepack.updatepkg import gen_update_pkg, MissingData
 
 
 def run_command(argv):
+
+    # pylint: disable=too-many-statements
+
     oparser = OptionParser(usage="usage: %prog gen_update [options] [xmlfile]")
     oparser.add_option("-t", "--target", dest="target",
                        help="directoryname of target")
diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
index 0523136b..2bd52a65 100644
--- a/elbepack/commands/init.py
+++ b/elbepack/commands/init.py
@@ -24,6 +24,10 @@ from optparse import OptionParser
 
 
 def run_command(argv):
+
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-statements
+
     oparser = OptionParser(usage="usage: %prog init [options] <filename>")
 
     oparser.add_option("--skip-validation", action="store_true",
diff --git a/elbepack/commands/mkcdrom.py b/elbepack/commands/mkcdrom.py
index 9eae9187..f00e9645 100644
--- a/elbepack/commands/mkcdrom.py
+++ b/elbepack/commands/mkcdrom.py
@@ -21,6 +21,9 @@ from elbepack.cdroms import mk_source_cdrom, mk_binary_cdrom, CDROM_SIZE
 
 
 def run_command(argv):
+
+    # pylint disable=too-many-statements
+
     oparser = OptionParser(usage="usage: %prog mkcdrom [options] <builddir>")
     oparser.add_option("--skip-validation", action="store_true",
                        dest="skip_validation", default=False,
diff --git a/elbepack/commands/parselicence.py b/elbepack/commands/parselicence.py
index e84ea3e5..c56b3185 100644
--- a/elbepack/commands/parselicence.py
+++ b/elbepack/commands/parselicence.py
@@ -125,6 +125,10 @@ def license_string(pkg):
 
 
 def run_command(argv):
+
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-statements
+
     oparser = OptionParser(
         usage="usage: %prog parselicence [options] <licencefile>")
     oparser.add_option("--output", dest="output",
diff --git a/elbepack/commands/pkgdiff.py b/elbepack/commands/pkgdiff.py
index c89c0900..4810a932 100644
--- a/elbepack/commands/pkgdiff.py
+++ b/elbepack/commands/pkgdiff.py
@@ -20,6 +20,8 @@ from elbepack.elbexml import ElbeXML, ValidationMode
 
 def run_command(argv):
 
+    # pylint: disable=too-many-locals
+
     oparser = OptionParser(
         usage="usage: %prog pkgdiff [options] <rfs1> <rfs2>")
     oparser.add_option(
diff --git a/elbepack/commands/prjrepo.py b/elbepack/commands/prjrepo.py
index a1819ee0..9c18b084 100644
--- a/elbepack/commands/prjrepo.py
+++ b/elbepack/commands/prjrepo.py
@@ -21,6 +21,9 @@ from elbepack.config import cfg
 
 
 def run_command(argv):
+
+    # pylint: disable=too-many-statements
+
     oparser = OptionParser(usage="usage: elbe prjrepo [options] <command>")
 
     oparser.add_option("--host", dest="host", default=cfg['soaphost'],
diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index 745b8a3a..816f8da5 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -62,6 +62,9 @@ class ESoap (ServiceBase):
     @soap_faults
     @authenticated_admin
     def add_user(self, name, fullname, password, email, admin):
+
+        # pylint: disable=too-many-arguments
+
         self.app.pm.db.add_user(name, fullname, password, email, admin)
 
     @rpc(_returns=Array(SoapProject))
@@ -81,6 +84,9 @@ class ESoap (ServiceBase):
     @authenticated_uid
     @soap_faults
     def upload_file(self, uid, builddir, fname, blob, part):
+
+        # pylint: disable=too-many-arguments
+
         fn = os.path.join(builddir, fname)
         if (part == 0):
             if self.app.pm.db.is_busy(builddir):
@@ -163,6 +169,9 @@ class ESoap (ServiceBase):
     @authenticated_uid
     @soap_faults
     def build(self, uid, builddir, build_bin, build_src, skip_pbuilder):
+
+        # pylint: disable=too-many-arguments
+
         self.app.pm.open_project(uid, builddir)
         self.app.pm.build_current_project(uid, build_bin, build_src,
                                           skip_pbuilder)
diff --git a/elbepack/db.py b/elbepack/db.py
index fe03ec46..44fe2475 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -863,6 +863,9 @@ class ElbeDB(object):
                                               "Pbuilder artifact")
 
     def _update_project_file(self, s, builddir, name, mime_type, description):
+
+        # pylint: disable=too-many-arguments
+
         filename = os.path.join(builddir, name)
         try:
             f = s.query(ProjectFile).\
@@ -888,6 +891,9 @@ class ElbeDB(object):
         return filename
 
     def add_user(self, name, fullname, password, email, admin):
+
+        # pylint: disable=too-many-arguments
+
         # encrypt is deprecated but hash is not available in jessie
         try:
             hash = pbkdf2_sha512.hash(password)
@@ -908,6 +914,9 @@ class ElbeDB(object):
 
     def modify_user(self, userid, name, fullname, email, admin,
                     password=None):
+
+        # pylint: disable=too-many-arguments
+
         with session_scope(self.session) as s:
             try:
                 u = s.query(User).filter(User.id == userid).one()
@@ -1007,6 +1016,9 @@ class ElbeDB(object):
 
     @classmethod
     def init_db(cls, name, fullname, password, email, admin):
+
+        # pylint: disable=too-many-arguments
+
         if not os.path.exists(cls.db_path):
             try:
                 os.makedirs(cls.db_path)
diff --git a/elbepack/debpkg.py b/elbepack/debpkg.py
index 0118d73b..ede724cc 100644
--- a/elbepack/debpkg.py
+++ b/elbepack/debpkg.py
@@ -48,6 +48,9 @@ def build_binary_deb(
         files,
         deps,
         target_dir):
+
+    # pylint: disable=too-many-arguments
+
     tmpdir = mkdtemp()
     pkgfname = "%s_%s_%s" % (name, version, arch)
     pkgdir = os.path.join(tmpdir, pkgfname)
diff --git a/elbepack/dump.py b/elbepack/dump.py
index 13fb811e..11513328 100644
--- a/elbepack/dump.py
+++ b/elbepack/dump.py
@@ -80,6 +80,9 @@ def dump_initvmpkgs(xml):
 
 
 def check_full_pkgs(pkgs, fullpkgs, errorname, cache):
+
+    # pylint: disable=too-many-statements
+
     elog = ASCIIDocLog(errorname, True)
 
     elog.h1("ELBE Package validation")
@@ -162,6 +165,11 @@ def check_full_pkgs(pkgs, fullpkgs, errorname, cache):
 
 
 def elbe_report(xml, buildenv, cache, reportname, errorname, targetfs):
+
+    # pylint: disable=too-many-arguments
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-statements
+
     outf = ASCIIDocLog(reportname)
     rfs = buildenv.rfs
 
diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index 3366c97f..9ea4c989 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -41,6 +41,9 @@ def copy_filelist(src, filelist, dst):
 
 
 def extract_target(src, xml, dst, log, cache):
+
+    # pylint: disable=too-many-locals
+
     # create filelists describing the content of the target rfs
     if xml.tgt.has("tighten") or xml.tgt.has("diet"):
         pkglist = [n.et.text for n in xml.node(
diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 30797c39..a426481c 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -117,6 +117,9 @@ class ElbeProject (object):
             presh_file=None,
             postsh_file=None,
             savesh_file=None):
+
+        # pylint: disable=too-many-arguments
+
         self.builddir = os.path.abspath(str(builddir))
         self.chrootpath = os.path.join(self.builddir, "chroot")
         self.targetpath = os.path.join(self.builddir, "target")
@@ -407,6 +410,10 @@ class ElbeProject (object):
               build_sources=False, cdrom_size=None, debug=False,
               skip_pkglist=False, skip_pbuild=False):
 
+        # pylint: disable=too-many-arguments
+        # pylint: disable=too-many-locals
+        # pylint: disable=too-many-statements
+
         # Write the log header
         self.write_log_header()
 
@@ -780,6 +787,9 @@ class ElbeProject (object):
                         datetime.datetime.now().strftime("%Y%m%d-%H%M%S"))
 
     def install_packages(self, target, buildenv=False):
+
+        # pylint: disable=too-many-statements
+
         with target:
             # First update the apt cache
             try:
diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
index cf117dc6..27feb15d 100644
--- a/elbepack/elbexml.py
+++ b/elbepack/elbexml.py
@@ -181,9 +181,14 @@ class ElbeXML(object):
         return ret
 
     def validate_apt_sources(self, url_validation, buildtype):
+
+        # pylint disable=too-many-locals
+
         slist = self.create_apt_sources_list()
         sources_lines = slist.split('\n')
 
+        # pylint: disable=too-many-locals
+
         repos = []
         for line in sources_lines:
             line = re.sub(r'\[.*\] ', '', line)
diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index 11c448d8..0ccdae7d 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -385,6 +385,8 @@ class UpdatedAction(FinetuningAction):
 
     def execute(self, log, buildenv, target):
 
+        # pylint: disable=too-many-locals
+
         if self.node.et.text:
             fp = self.node.et.text
             log.printo("transfer gpg key to target: " + fp)
diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index d5f64958..fb7e7922 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -363,6 +363,8 @@ def create_partition(
         size_in_sectors,
         current_sector):
 
+    # pylint: disable=too-many-arguments
+
     sector_size = 512
     if part.text("size") == "remain" and disk.type == "gpt":
         sz = size_in_sectors - 35 - current_sector
@@ -396,6 +398,8 @@ def create_partition(
 
 def create_label(outf, disk, part, ppart, fslabel, target, grub):
 
+    # pylint: disable=too-many-arguments
+
     sector_size = 512
     partition_number = ppart.number
     entry = fslabel[part.text("label")]
@@ -440,6 +444,8 @@ def create_logical_partitions(
         target,
         grub):
 
+    # pylint: disable=too-many-arguments
+
     current_sector = epart.geometry.start
     size_in_sectors = current_sector + epart.geometry.length
 
@@ -463,6 +469,9 @@ def create_logical_partitions(
 
 def do_image_hd(outf, hd, fslabel, target, grub_version, grub_fw_type):
 
+    # pylint: disable=too-many-arguments
+    # pylint: disable=too-many-locals
+
     sector_size = 512
     s = size_to_int(hd.text("size"))
     size_in_sectors = s / sector_size
@@ -560,6 +569,10 @@ def add_binary_blob(outf, hd, target):
 
 
 def do_hdimg(outf, xml, target, rfs, grub_version, grub_fw_type):
+
+    # pylint: disable=too-many-arguments
+    # pylint: disable=too-many-locals
+
     # list of created files
     img_files = []
 
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index 041d6549..5cb0ac24 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -251,6 +251,11 @@ class CreateAction(InitVMAction):
         InitVMAction.__init__(self, node, initvmNeeded=False)
 
     def execute(self, initvmdir, opt, args):
+
+        # pylint: disable=too-many-locals
+        # pylint: disable=too-many-branches
+        # pylint: disable=too-many-statements
+
         if self.initvm is not None:
             print("Initvm already defined.\n")
             print("If you want to build in your old initvm, "
@@ -547,6 +552,11 @@ class SubmitAction(InitVMAction):
         InitVMAction.__init__(self, node)
 
     def execute(self, _initvmdir, opt, args):
+
+        # pylint: disable=too-many-locals
+        # pylint: disable=too-many-statements
+        # pylint: disable=too-many-branches
+
         try:
             system('%s initvm ensure' % elbe_exe)
         except CommandError:
diff --git a/elbepack/licencexml.py b/elbepack/licencexml.py
index 94917870..c2615aea 100644
--- a/elbepack/licencexml.py
+++ b/elbepack/licencexml.py
@@ -49,6 +49,8 @@ class copyright_xml (object):
 
     def add_copyright_file(self, pkg_name, copyright):
 
+        # pylint: disable=too-many-locals
+
         # remove illegal characters from copyright
         copyright, _ = remove_re.subn('', copyright)
 
diff --git a/elbepack/pbuilderaction.py b/elbepack/pbuilderaction.py
index 574f0f47..9e141be0 100644
--- a/elbepack/pbuilderaction.py
+++ b/elbepack/pbuilderaction.py
@@ -158,6 +158,9 @@ class BuildAction(PBuilderAction):
         PBuilderAction.__init__(self, node)
 
     def execute(self, opt, _args):
+
+        # pylint: disable=too-many-statements
+
         tmp = TmpdirFilesystem()
 
         if opt.xmlfile:
diff --git a/elbepack/pkgarchive.py b/elbepack/pkgarchive.py
index 6c687fbb..4d35260f 100644
--- a/elbepack/pkgarchive.py
+++ b/elbepack/pkgarchive.py
@@ -15,6 +15,8 @@ class ArchiveRepo(RepoBase):
     def __init__(self, xml, path, log, origin, description, components,
                  maxsize=None):
 
+        # pylint: disable=too-many-arguments
+
         arch = xml.text("project/arch", key="arch")
         codename = xml.text("project/suite")
 
@@ -99,6 +101,10 @@ def gen_binpkg_archive(ep, repodir):
 
 
 def checkout_binpkg_archive(ep, repodir):
+
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-statements
+
     repopath = path.join(ep.builddir, repodir)
     sources_list = ep.buildenv.rfs.fname('etc/apt/sources.list')
     sources_list_d = ep.buildenv.rfs.fname('etc/apt/sources.list.d')
diff --git a/elbepack/pkgutils.py b/elbepack/pkgutils.py
index ed6678e2..70ec2561 100644
--- a/elbepack/pkgutils.py
+++ b/elbepack/pkgutils.py
@@ -91,6 +91,9 @@ def get_initrd_pkg(prj, defs):
 
 
 def get_url(arch, suite, target_pkg, mirror, comp='main'):
+
+    # pylint: disable=too-many-locals
+
     try:
         pack_url = "%s/dists/%s/%s/binary-%s/Packages" % (
             mirror.replace("LOCALMACHINE", "localhost"), suite, comp, arch)
@@ -204,6 +207,10 @@ def download_pkg(prj,
                  incl_deps=False,
                  log=None):
 
+    # pylint: disable=too-many-arguments
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-branches
+
     try:
         urilist = get_uri(prj, defs, arch, package, incl_deps)
     except KeyError:
@@ -255,6 +262,8 @@ def download_pkg(prj,
 def extract_pkg(prj, target_dir, defs, package, arch="default",
                 incl_deps=False, log=None):
 
+    # pylint: disable=too-many-arguments
+
     pkgs = download_pkg(prj, target_dir, defs, package, arch, incl_deps, log)
 
     for package in pkgs:
diff --git a/elbepack/repomanager.py b/elbepack/repomanager.py
index 1a299f3d..2df62cff 100644
--- a/elbepack/repomanager.py
+++ b/elbepack/repomanager.py
@@ -64,6 +64,8 @@ class RepoBase(object):
             description,
             maxsize=None):
 
+        # pylint: disable=too-many-arguments
+
         self.vol_path = path
         self.volume_count = 0
 
@@ -335,6 +337,8 @@ class CdromInitRepo(RepoBase):
     def __init__(self, arch, init_codename, path, log, maxsize,
                  mirror='http://ftp.de.debian.org/debian'):
 
+        # pylint: disable=too-many-arguments
+
         init_attrs = RepoAttributes(
             init_codename, "amd64", [
                 "main", "main/debian-installer"], mirror)
@@ -360,6 +364,8 @@ class CdromBinRepo(RepoBase):
             maxsize,
             mirror='http://ftp.debian.org/debian'):
 
+        # pylint: disable=too-many-arguments
+
         repo_attrs = RepoAttributes(codename, arch, ["main", "added"], mirror)
         if init_codename is not None:
             init_attrs = RepoAttributes(
@@ -382,6 +388,8 @@ class CdromSrcRepo(RepoBase):
     def __init__(self, codename, init_codename, path, log, maxsize,
                  mirror='http://ftp.debian.org/debian'):
 
+        # pylint: disable=too-many-arguments
+
         repo_attrs = RepoAttributes(codename,
                                     "source",
                                     ["main", "added"],
diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index b8c19a39..1e1e411f 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -25,6 +25,8 @@ class DebootstrapException (Exception):
 class BuildEnv ():
     def __init__(self, xml, log, path, build_sources=False, clean=False):
 
+        # pylint: disable=too-many-arguments
+
         self.xml = xml
         self.log = log
         self.path = path
@@ -87,6 +89,8 @@ class BuildEnv ():
 
     def debootstrap(self):
 
+        # pylint: disable=too-many-statements
+
         cleanup = False
         suite = self.xml.prj.text("suite")
 
diff --git a/elbepack/rpcaptcache.py b/elbepack/rpcaptcache.py
index d7601558..eb72fe81 100644
--- a/elbepack/rpcaptcache.py
+++ b/elbepack/rpcaptcache.py
@@ -36,6 +36,9 @@ class RPCAPTCache(InChRootObject):
             notifier=None,
             norecommend=False,
             noauth=True):
+
+        # pylint: disable=too-many-arguments
+
         sys.stdout = open(log, 'a', buffering=0)
         sys.stderr = open(log, 'a', buffering=0)
         self.logfile = open(log, 'a', buffering=0)
@@ -273,6 +276,9 @@ def get_rpcaptcache(
         notifier=None,
         norecommend=False,
         noauth=True):
+
+    # pylint: disable=too-many-arguments
+
     mm = MyMan()
     mm.start()
 
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index 0980992a..beff897c 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -45,6 +45,8 @@ def set_suds_debug(debug):
 class ElbeSoapClient(object):
     def __init__(self, host, port, user, passwd, retries=10, debug=False):
 
+        # pylint: disable=too-many-arguments
+
         # Mess with suds logging, for debug, or squelch warnings
         set_suds_debug(debug)
 
diff --git a/elbepack/updated.py b/elbepack/updated.py
index f5a3c426..17597658 100644
--- a/elbepack/updated.py
+++ b/elbepack/updated.py
@@ -247,6 +247,8 @@ def mark_install(depcache, pkg, version, auto, status):
 
 def _apply_update(fname, status):
 
+    # pylint: disable=too-many-locals
+
     try:
         xml = etree(fname)
     except BaseException:
@@ -425,6 +427,11 @@ def apply_update(fname, status):
 
 def action_select(upd_file, status):
 
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-return-statements
+    # pylint: disable=too-many-branches
+    # pylint: disable=too-many-statements
+
     status.log("updating: " + upd_file)
 
     try:
diff --git a/elbepack/updatepkg.py b/elbepack/updatepkg.py
index 39805b0a..d1a0a86b 100644
--- a/elbepack/updatepkg.py
+++ b/elbepack/updatepkg.py
@@ -35,6 +35,10 @@ def gen_update_pkg(project, xml_filename, upd_filename,
                    override_buildtype=None, skip_validate=False, debug=False,
                    cmd_dir=None, cfg_dir=None):
 
+    # pylint: disable=too-many-arguments
+    # pylint: disable=too-many-locals
+    # pylint: disable=too-many-statements
+
     if xml_filename:
         xml = ElbeXML(xml_filename, buildtype=override_buildtype,
                       skip_validate=skip_validate)
diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 5361278a..1ddaa584 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -74,6 +74,8 @@ def lookup_uri(v, d, target_pkg):
 class VirtApt:
     def __init__(self, arch, suite, sources, prefs, keylist=[], noauth=False):
 
+        # pylint: disable=too-many-arguments
+
         self.projectpath = mkdtemp()
         self.initialize_dirs()
 
diff --git a/elbepack/xmlpreprocess.py b/elbepack/xmlpreprocess.py
index 7697730e..a3df90e7 100644
--- a/elbepack/xmlpreprocess.py
+++ b/elbepack/xmlpreprocess.py
@@ -23,6 +23,8 @@ class XMLPreprocessError(Exception):
 
 def xmlpreprocess(fname, output, variants=[]):
 
+    # pylint: disable=too-many-locals
+
     # first convert variants to a set
     variants = set(variants)
 
-- 
2.11.0




More information about the elbe-devel mailing list