From: Christian Heller Date: Sun, 10 Aug 2025 12:52:29 +0000 (+0200) Subject: With .log a lambda to "or True", no need to check non-boolean returns. X-Git-Url: https://plomlompom.com/repos/booking/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/blog?a=commitdiff_plain;h=c2717a422bf47a979ebcf975088bc1c6f2b4bbfa;p=ircplom With .log a lambda to "or True", no need to check non-boolean returns. --- diff --git a/ircplom/client_tui.py b/ircplom/client_tui.py index f29317d..7274bca 100644 --- a/ircplom/client_tui.py +++ b/ircplom/client_tui.py @@ -147,15 +147,13 @@ class ClientTui(BaseTui): return super()._log_target_wins(**kwargs) def for_client_do(self, client_id: str, todo: str, **kwargs) -> None: - 'Forward todo to appropriate _ClientWindowManager.' + 'Forward todo to appropriate _ClientWindowsManager.' if client_id not in self._client_mngrs: self._client_mngrs[client_id] = _ClientWindowsManager( client_id=client_id, tui_log=self._targeted_log, new_window=lambda cls, **kw: self._new_window( cls, _q_out=self._q_out, client_id=client_id, **kw)) - client_data = self._client_mngrs[client_id] - method = getattr(client_data, todo) - if method(**kwargs) or signature(method).return_annotation is None: + if getattr(self._client_mngrs[client_id], todo)(**kwargs): self.redraw_affected() def cmd__connect(self,