[elbe-devel] [PATCH 68/75] rpcaptcache: Fix Pylint
Olivier Dion
dion at linutronix.de
Mon May 25 17:43:01 CEST 2020
35:4: W0221: (arguments-differ)
55:4: W0221: (arguments-differ)
62:0: R0205: (useless-object-inheritance)
118:19: R1718: (consider-using-set-comprehension)
211:33: W0613: (unused-argument)
292:4: R0201: (no-self-use)
Signed-off-by: Olivier Dion <dion at linutronix.de>
---
elbepack/rpcaptcache.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/elbepack/rpcaptcache.py b/elbepack/rpcaptcache.py
index 5a1bb01a..bfe8acfb 100644
--- a/elbepack/rpcaptcache.py
+++ b/elbepack/rpcaptcache.py
@@ -31,6 +31,7 @@ soap = logging.getLogger("soap")
class MyMan(BaseManager):
+ # pylint: disable=arguments-differ
@staticmethod
def register(typeid):
"""Register to BaseManager through decorator"""
@@ -52,13 +53,15 @@ class MyMan(BaseManager):
os.sys.__stdout__ = os.sys.stdout
os.sys.__stderr__ = os.sys.stderr
+ # pylint: disable=arguments-differ
def start(self):
"""Redirect outputs of the process to an async logging thread"""
r, w = os.pipe()
super(MyMan, self).start(MyMan.redirect_outputs, [r, w])
async_logging(r, w, soap, log)
-
+# TODO:py3 Remove object inheritance
+# pylint: disable=useless-object-inheritance
class InChRootObject(object):
def __init__(self, rfs):
self.rfs = rfs
@@ -115,7 +118,7 @@ class RPCAPTCache(InChRootObject):
p.is_upgradable))
def get_sections(self):
- ret = list(set([p.section for p in self.cache]))
+ ret = list({p.section for p in self.cache})
ret.sort()
return ret
@@ -208,7 +211,7 @@ class RPCAPTCache(InChRootObject):
p = self.cache[pkgname]
p.mark_delete(purge=True)
- def mark_keep(self, pkgname, version):
+ def mark_keep(self, pkgname, _version):
p = self.cache[pkgname]
p.mark_keep()
@@ -288,8 +291,8 @@ class RPCAPTCache(InChRootObject):
APTPackage(
self.cache[p]) for p in sorted(
self.cache.keys()) if pkgname in p.lower()]
-
- def compare_versions(self, ver1, ver2):
+ @staticmethod
+ def compare_versions(ver1, ver2):
return version_compare(ver1, ver2)
def download_binary(self, pkgname, path, version=None):
--
2.26.2
More information about the elbe-devel
mailing list