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

Torben Hohn torben.hohn at linutronix.de
Fri May 29 13:15:23 CEST 2020


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

Reviewed-by: Torben Hohn <torben.hohn 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
> 
> 
> _______________________________________________
> 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