From: Christian Heller Date: Mon, 25 Aug 2025 20:06:50 +0000 (+0200) Subject: Minor refactoring. X-Git-Url: https://plomlompom.com/repos/tasks?a=commitdiff_plain;h=38480141a2c92fc258347df191e2fc43cf851354;p=ircplom Minor refactoring. --- diff --git a/ircplom/client.py b/ircplom/client.py index babc87f..5f5167e 100644 --- a/ircplom/client.py +++ b/ircplom/client.py @@ -415,10 +415,6 @@ class _UpdatingDict: self._dict.clear() self._on_update('') - def has(self, key: str) -> bool: - 'Test if entry of name in dictionary.' - return key in self._dict - def __getitem__(self, key: str): return self._dict[key] @@ -955,7 +951,7 @@ class Client(ABC, ClientQueueMixin): elif ret['verb'] == 'CAP': if (self._caps.process_msg(verb=ret['subverb'], items=ret['items'], incomplete='tbc' in ret) - and self._db.caps.has('sasl') + and 'sasl' in self._db.caps.keys and 'PLAIN' in self._db.caps['sasl'].data.split(',')): if self._db.password: self._db.sasl_auth_state = 'attempting' diff --git a/ircplom/client_tui.py b/ircplom/client_tui.py index a4e9e93..3792fa6 100644 --- a/ircplom/client_tui.py +++ b/ircplom/client_tui.py @@ -396,7 +396,7 @@ class _ClientKnowingTui(Client): value = getattr(chan, arg) else: d = getattr(self._db, path) - if d.has(arg): + if arg in d.keys: value = d[arg] if isinstance(value, ServerCapability): display = 'ENABLED' if value.enabled else 'available'