[elbe-devel] [PATCH 48/75] projectmanager: Fix Pylint

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


60:0:   R0205: (useless-object-inheritance)
67:0:   R0205: (useless-object-inheritance)
128:16: R1705: (no-else-return)

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/projectmanager.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index 0aca90ff..c03874d5 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -56,14 +56,16 @@ class InvalidState(ProjectManagerError):
     def __init__(self, message):
         ProjectManagerError.__init__(self, message)
 
-
+# TODO:py3 Remove object inheritance
+# pylint: disable=useless-object-inheritance
 class OpenProjectFile(object):
     def __init__(self, pfd, mode='r'):
         self.path = path.join(pfd.builddir, pfd.name)
         self.mime_type = pfd.mime_type
         self.fobj = open(self.path, mode)
 
-
+# TODO:py3 Remove object inheritance
+# pylint: disable=useless-object-inheritance
 class ProjectManager(object):
 
     # pylint: disable=too-many-public-methods
@@ -129,11 +131,10 @@ class ProjectManager(object):
                     # Same project selected again by the same user, don't do
                     # anything
                     return
-                else:
-                    # Already opened by a different user
-                    raise AlreadyOpen(builddir,
-                                      self.db.get_username(
-                                          self.builddir2userid[builddir]))
+
+                # Already opened by a different user
+                raise AlreadyOpen(builddir,
+                                  self.db.get_username(self.builddir2userid[builddir]))
 
             # Try to close the old project of the user, if any
             self._close_current_project(userid)
-- 
2.26.2




More information about the elbe-devel mailing list