Linting...

This commit is contained in:
Yohann D'ANELLO 2020-10-09 17:04:32 +02:00
parent cb3a0ce4da
commit bec53dbf1e

View File

@ -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()