[elbe-devel] [PATCH 68/75] rpcaptcache: Fix Pylint
Torben Hohn
torben.hohn at linutronix.de
Fri May 29 17:03:04 CEST 2020
On Mon, May 25, 2020 at 11:43:01AM -0400, Olivier Dion wrote:
> 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>
Reviewed-by: Torben Hohn <torben.hohn 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
>
>
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel
--
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/kontakt/Datenschutz.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
More information about the elbe-devel
mailing list