[elbe-devel] [PATCH 53/75] virtapt: Fix Pylint

Olivier Dion dion at linutronix.de
Mon May 25 17:42:46 CEST 2020


25:0:   W0404: (reimported)
78:0:   R0205: (useless-object-inheritance)
79:4:   R0915: (too-many-statements)
181:4:  R0201: (no-self-use)
249:20: E1101: (no-member)
14:0:   W0611: (unused-import)
25:0:   W0611: (unused-import)
27:0:   W0611: (unused-import)
25:0:   C0412: (ungrouped-imports)

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/virtapt.py | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index f74facd0..b7c7d2c6 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -11,9 +11,6 @@ from __future__ import print_function
 import os
 import sys
 
-from multiprocessing.managers import BaseManager
-
-from elbepack.shellhelper import system
 
 # don't remove the apt import, it is really needed, due to some magic in
 # apt_pkg
@@ -22,9 +19,8 @@ import apt  # pylint: disable=unused-import
 import apt_pkg
 
 
-from elbepack.shellhelper import CommandError, system
+from elbepack.shellhelper import system
 from elbepack.filesystem import TmpdirFilesystem
-from elbepack.xmldefaults import ElbeDefaults
 from elbepack.rfs import create_apt_prefs
 
 
@@ -74,10 +70,12 @@ def lookup_uri(v, d, target_pkg):
 
     return target_pkg, uri, hashval
 
-
+# TODO:py3 Remove object inheritance
+# pylint: disable=useless-object-inheritance
 class VirtApt(object):
     def __init__(self, xml):
 
+        # pylint: disable=too-many-statements
         self.xml = xml
 
         arch = xml.text("project/buildimage/arch", key="arch")
@@ -178,7 +176,8 @@ class VirtApt(object):
     def stop(self):
         pass
 
-    def pulse(self, _obj):
+    @staticmethod
+    def pulse(_obj):
         return True
 
     def initialize_dirs(self):
@@ -246,6 +245,9 @@ class VirtApt(object):
 
     def get_downloaded_files(self):
         ret = []
+        # TODO:py3 - Change for items().  Keep iteritems() for py2
+        # since it's more performant.
+        # pylint: disable=no-member
         for _, d in self.downloads.iteritems():
             if d.complete:
                 ret.append(d.destfile)
-- 
2.26.2




More information about the elbe-devel mailing list