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

Olivier Dion dion at linutronix.de
Mon May 25 17:42:34 CEST 2020


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"):
             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




More information about the elbe-devel mailing list