[elbe-devel] [PATCH 19/75] debianize base tui: Fix Pylint

Torben Hohn torben.hohn at linutronix.de
Fri May 29 11:49:10 CEST 2020


On Mon, May 25, 2020 at 11:42:12AM -0400, Olivier Dion wrote:
> 49:0:  R0205: (useless-object-inheritance)
> 58:0:  R0205: (useless-object-inheritance)
> 141:4: R1710: (inconsistent-return-statements)
> 163:0: W0613: (unused-argument)
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

i would like to remove the TUI in the near future.
It doesnt work on all terminals (seems to work on xterm, but not on
gnome-terminal with big fonts.)

I have a prototype in devel/torbenh/files
there is also a fixdebianize branch, where i revert your tui, and
reestablish the old debianstuff. maybe its not pushed yet.


Where the UI is generating an .ini file, that is edited using $EDITOR
which i then read back in.

I dont remember the details anymore. Maybe it resembles you new widgets,
or the old ui scheme.

This approach has the advantage, that we can seed some input for tests,
much easier, than with ncurses stuff.

Maybe you can polish it, when you run out of work.
Since this will easy testing debianize, we can put this under the
testing umbrella.

I will skip the tui patches for now.

> ---
>  elbepack/debianize/base/tui.py | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/elbepack/debianize/base/tui.py b/elbepack/debianize/base/tui.py
> index e0ca5e26..2174f2b7 100644
> --- a/elbepack/debianize/base/tui.py
> +++ b/elbepack/debianize/base/tui.py
> @@ -45,7 +45,8 @@ def generate_helper_text(hints):
>          markup.extend((("helper_key", key), " ", (text_palette, text), " "))
>      return markup
>  
> -
> +# TODO:py3 Remove object inheritance
> +# pylint: disable=useless-object-inheritance
>  class TUISignal(object):
>      QUIT = "on_quit"
>      CLICK = "on_click"
> @@ -54,7 +55,8 @@ class TUISignal(object):
>  class TUIException(Exception):
>      pass
>  
> -
> +# TODO:py3 Remove object inheritance
> +# pylint: disable=useless-object-inheritance
>  class TUI(object):
>  
>      palette = [
> @@ -141,7 +143,8 @@ class TUI(object):
>      def unhandled_input(cls, key):
>          if key in cls.keybind:
>              cls.keybind[key]()
> -            return None
> +            return True
> +        return False
>  
>      @classmethod
>      def bind_global(cls, key, callback):
> @@ -160,7 +163,7 @@ class TUI(object):
>          raise ExitMainLoop()
>  
>      @staticmethod
> -    def pause(*args):
> +    def pause(*_args):
>          TUI.loop.stop()
>          os.kill(os.getpid(), signal.SIGSTOP)
>          TUI.loop.start()
> -- 
> 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