From 2149aa50b9d7f0b43a9d96a06076fb4a96c6346d Mon Sep 17 00:00:00 2001 From: mecaneer23 Date: Mon, 29 Apr 2024 14:52:18 -0500 Subject: [PATCH] refactor: make local constant private --- src/acurses.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/acurses.py b/src/acurses.py index 4422408..c8fb371 100644 --- a/src/acurses.py +++ b/src/acurses.py @@ -111,7 +111,7 @@ def set_blocking(self, block: bool) -> None: self._block = block -GETCH = _Getch() +_GETCH = _Getch() class _CursesWindow: # pylint: disable=too-many-instance-attributes @@ -144,20 +144,20 @@ def getch(self) -> int: there is no input, otherwise wait until a key is pressed. """ - if not GETCH.is_blocking(): + if not _GETCH.is_blocking(): try: return self._stored_keys.get(block=False) except queue_empty: return -1 if not self._stored_keys.empty(): return self._stored_keys.get() - char = GETCH.get() + char = _GETCH.get() current = [char] if char == 27: esc = now() while now() - esc < _SHORT_TIME_SECONDS: try: - char = GETCH.get(timeout=_SHORT_TIME_SECONDS) + char = _GETCH.get(timeout=_SHORT_TIME_SECONDS) except queue_empty: break if char not in current: @@ -259,7 +259,7 @@ def addch(self, y: int, x: int, char: str, attr: int = 0) -> None: def nodelay(self, flag: bool = True) -> None: """If flag is True, getch() will be non-blocking""" - GETCH.set_blocking(not flag) + _GETCH.set_blocking(not flag) def box(self) -> None: """Draw a border around the current window"""