[elbe-devel] [PATCH 30/75] efilesystem: Fix Pylint

Torben Hohn torben.hohn at linutronix.de
Fri May 29 12:16:56 CEST 2020


On Mon, May 25, 2020 at 11:42:23AM -0400, Olivier Dion wrote:
> 223:0:  R0205: (useless-object-inheritance)
> 239:12: W0212: (protected-access)
> 246:16: W0212: (protected-access)
> 248:16: W0212: (protected-access)
> 248:34: W0212: (protected-access)
> 271:4:  R0201: (no-self-use)
> 361:4:  R0201: (no-self-use)
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

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

> ---
>  elbepack/efilesystem.py | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
> index b74f0ac3..40865c28 100644
> --- a/elbepack/efilesystem.py
> +++ b/elbepack/efilesystem.py
> @@ -219,7 +219,8 @@ class ElbeFilesystem(Filesystem):
>          if xml_fname is not None:
>              licence_xml.write(xml_fname)
>  
> -
> +# TODO:py3 Remove object inheritance
> +# pylint: disable=useless-object-inheritance
>  class Excursion(object):
>  
>      RFS = {}
> @@ -236,12 +237,14 @@ class Excursion(object):
>      def do(cls, rfs):
>          r = cls.RFS[rfs.path]
>          for tmp in r:
> +            # pylint: disable=protected-access
>              tmp._do_excursion(rfs)
>  
>      @classmethod
>      def end(cls, rfs):
>          r = cls.RFS[rfs.path]
>          for tmp in r:
> +            # pylint: disable=protected-access
>              if tmp.origin not in rfs.protect_from_excursion:
>                  tmp._undo_excursion(rfs)
>              else:
> @@ -268,7 +271,8 @@ class Excursion(object):
>              system('cp %s %s' % (self.origin, rfs.fname(dst)))
>  
>      # This should be a method of rfs
> -    def _del_rfs_file(self, filename, rfs):
> +    @staticmethod
> +    def _del_rfs_file(filename, rfs):
>          if rfs.lexists(filename):
>              flags = "-f"
>              if rfs.isdir(filename):
> @@ -359,17 +363,18 @@ class ChRootFilesystem(ElbeFilesystem):
>          os.chroot(self.path)
>  
>      def _umount(self, path):
> +        path = os.path.join(self.path, path)
>          if os.path.ismount(path):
>              system("umount %s" % path)
>  
>      def umount(self):
>          if self.path == '/':
>              return
> -        self._umount("%s/proc/sys/fs/binfmt_misc" % self.path)
> -        self._umount("%s/proc" % self.path)
> -        self._umount("%s/sys" % self.path)
> -        self._umount("%s/dev/pts" % self.path)
> -        self._umount("%s/dev" % self.path)
> +        self._umount("proc/sys/fs/binfmt_misc")
> +        self._umount("proc")
> +        self._umount("sys")
> +        self._umount("dev/pts")
> +        self._umount("dev")
>  
>      def leave_chroot(self):
>          assert self.inchroot
> -- 
> 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