Linting...

This commit is contained in:
Yohann D'ANELLO 2020-10-09 17:04:32 +02:00
parent cb3a0ce4da
commit bec53dbf1e
1 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,8 @@
import curses import curses
from types import TracebackType
class TermManager():
class TermManager:
def __init__(self): def __init__(self):
self.screen = curses.initscr() self.screen = curses.initscr()
# convert escapes sequences to curses abstraction # convert escapes sequences to curses abstraction
@ -14,9 +15,10 @@ class TermManager():
curses.curs_set(False) curses.curs_set(False)
def __enter__(self): 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 # restore the terminal to its original state
self.screen.keypad(False) self.screen.keypad(False)
curses.echo() curses.echo()