From: Christian Heller Date: Wed, 6 Aug 2025 09:15:21 +0000 (+0200) Subject: Undo a few over-zealous name privatizations. X-Git-Url: https://plomlompom.com/repos/booking/%7B%7B%20web_path%20%7D%7D/decks/static/%7B%7Bdb.prefix%7D%7D/day?a=commitdiff_plain;p=ircplom Undo a few over-zealous name privatizations. --- diff --git a/ircplom/client.py b/ircplom/client.py index 598c62f..e55f148 100644 --- a/ircplom/client.py +++ b/ircplom/client.py @@ -253,7 +253,7 @@ class Client(ABC, ClientQueueMixin): self.log.add(f'{prefix} {"" if nick_confirmed else "un"}' 'confirmed') - def _close(self) -> None: + def close(self) -> None: 'Close both recv Loop and socket.' self.log.add(msg='disconnecting from server', chat=CHAT_GLOB) self._caps.clear() @@ -269,7 +269,7 @@ class Client(ABC, ClientQueueMixin): case 'PING': self.send(IrcMessage(verb='PONG', params=(msg.params[0],))) case 'ERROR': - self._close() + self.close() case '001' | 'NICK': self.update_login(nickname=msg.params[0], nick_confirmed=True) case 'PRIVMSG': diff --git a/ircplom/tui_base.py b/ircplom/tui_base.py index d7c4ba5..330fe0c 100644 --- a/ircplom/tui_base.py +++ b/ircplom/tui_base.py @@ -365,13 +365,13 @@ class BaseTui(QueueMixin): self._windows = [Window(idx=self._window_idx, term=self._term)] self._log = Logger( lambda msg: # pylint: disable=unnecessary-lambda # to keep … - self._window.log.append(msg)) # … up-to-date _what_ window's .log + self.window.log.append(msg)) # … up-to-date _what_ window's .log self._set_screen() signal(SIGWINCH, lambda *_: self._set_screen()) def redraw_affected(self) -> None: 'On focused window call .draw_tainted, then flush screen.' - self._window.draw_tainted() + self.window.draw_tainted() self._term.flush() def _set_screen(self) -> None: @@ -398,13 +398,13 @@ class BaseTui(QueueMixin): return None @property - def _window(self) -> Window: + def window(self) -> Window: 'Currently selected Window.' return self._windows[self._window_idx] def _switch_window(self, idx: int) -> None: self._window_idx = idx - self._window.draw() + self.window.draw() def handle_keyboard_event(self, typed_in: str) -> None: 'Translate keyboard input into appropriate actions.' @@ -428,16 +428,16 @@ class BaseTui(QueueMixin): to_paste += ' ' else: to_paste += '#' - self._window.prompt.insert(to_paste) + self.window.prompt.insert(to_paste) elif len(typed_in) == 1: - self._window.prompt.insert(typed_in) + self.window.prompt.insert(typed_in) else: self._log.alert(f'unknown keyboard input: {typed_in}') self.redraw_affected() def cmd__prompt_enter(self) -> None: - 'Get prompt content from ._window.prompt.enter, parse to & run command' - to_parse = self._window.prompt.enter() + 'Get prompt content from .window.prompt.enter, parse to & run command' + to_parse = self.window.prompt.enter() if not to_parse: return alert: Optional[str] = None