[elbe-devel] [PATCH 41/75] updated_monitors: Fix Pylint

Torben Hohn torben.hohn at linutronix.de
Fri May 29 12:58:30 CEST 2020


On Mon, May 25, 2020 at 11:42:34AM -0400, Olivier Dion wrote:
> 20:0:  R0205: (useless-object-inheritance)
> 36:20: E0602: (undefined-variable)
> 94:24: E0602: (undefined-variable)
> 93:8:  R0201: (no-self-use)
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>
> ---
>  elbepack/updated_monitors.py | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/elbepack/updated_monitors.py b/elbepack/updated_monitors.py
> index 9d4ecfb6..27a71a97 100644
> --- a/elbepack/updated_monitors.py
> +++ b/elbepack/updated_monitors.py
> @@ -16,7 +16,8 @@ except ImportError:
>  
>  from elbepack.updated import is_update_file, handle_update_file
>  
> -
> +# TODO:py3 Remove object inheritance
> +# pylint: disable=useless-object-inheritance
>  class UpdateMonitor(object):
>      def __init__(self, status):
>          self.status = status
> @@ -33,6 +34,7 @@ class UpdateMonitor(object):
>  
>  if udev_available:
>      def get_mountpoint_for_device(dev):
> +        # pylint: disable=undefined-variable
>          for line in file("/proc/mounts"):

file should be changed to open nowadays.
never disable undefined-variable

>              fields = line.split()
>              try:
> @@ -90,7 +92,9 @@ if udev_available:
>          def join(self):
>              self.observer.join()
>  
> -        def get_mountpoint_for_device(self, dev):
> +        @staticmethod
> +        def get_mountpoint_for_device(dev):
> +            # pylint: disable=undefined-variable
>              for line in file("/proc/mounts"):
>                  fields = line.split()
>                  try:
> @@ -100,7 +104,6 @@ if udev_available:
>                      pass
>              return None
>  
> -
>  class FileMonitor (UpdateMonitor):
>  
>      class EventHandler (pyinotify.ProcessEvent):
> -- 
> 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