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

Torben Hohn torben.hohn at linutronix.de
Fri May 29 16:37:45 CEST 2020


On Mon, May 25, 2020 at 11:42:46AM -0400, Olivier Dion wrote:
> 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

just change it to items() performance is not relevant here.

then:

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

>          for _, d in self.downloads.iteritems():
>              if d.complete:
>                  ret.append(d.destfile)
> -- 
> 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