From bec53dbf1e2499d62c72d083209fc648f57117b3 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 9 Oct 2020 17:04:32 +0200 Subject: [PATCH] Linting... --- dungeonbattle/{TermManager.py => term_manager.py} | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) rename dungeonbattle/{TermManager.py => term_manager.py} (76%) diff --git a/dungeonbattle/TermManager.py b/dungeonbattle/term_manager.py similarity index 76% rename from dungeonbattle/TermManager.py rename to dungeonbattle/term_manager.py index d4ba565..1f1d364 100644 --- a/dungeonbattle/TermManager.py +++ b/dungeonbattle/term_manager.py @@ -1,7 +1,8 @@ import curses +from types import TracebackType -class TermManager(): - + +class TermManager: def __init__(self): self.screen = curses.initscr() # convert escapes sequences to curses abstraction @@ -14,9 +15,10 @@ class TermManager(): curses.curs_set(False) def __enter__(self): - return self.screen + return self - def __exit__(self, type, value, traceback): + def __exit__(self, exc_type: type, exc_value: Exception, + exc_traceback: TracebackType) -> None: # restore the terminal to its original state self.screen.keypad(False) curses.echo()