class _UpdatingIsupportDict(_UpdatingDict[str]):
- def __init__(self, **kwargs) -> None:
- super().__init__(**kwargs)
- self._set_defaults()
-
- def _set_defaults(self):
- for key, value in ISUPPORT_DEFAULTS.items():
- self._dict[key] = value
-
def __delitem__(self, key: str) -> None:
if key in ISUPPORT_DEFAULTS:
self[key] = ISUPPORT_DEFAULTS[key]
def clear(self) -> None:
super().clear()
- self._set_defaults()
+ for key, value in ISUPPORT_DEFAULTS.items():
+ self[key] = value
class _ClientDb(_Clearable, _UpdatingAttrsMixin, SharedClientDbFields):
self.client_id = conn_setup.hostname
super().__init__(client_id=self.client_id, **kwargs)
self.db = _ClientDb(on_update=self._on_update)
+ self.db.clear()
self.caps = _CapsManager(self.send, self.db.caps)
for k in conn_setup.__annotations__:
setattr(self.db, k, getattr(conn_setup, k))
# ETC.
> /connect foo.bar.baz foo:bar baz
+1,2 $ isupport cleared
+1,2 $ isupport:CHANTYPES set to: [#&]
+1,2 $ isupport:PREFIX set to: [(ov)@+]
1,2 $ caps cleared
+1,2 $ users cleared
+1,2 $ channels cleared
1,2 $ hostname set to: [foo.bar.baz]
1,2 $ port set to: [-1]
1,2 $ nick_wanted set to: [foo]
1,2 $ connection_state set to: [connecting]
-1,2 $ channels cleared
-1,2 $ users cleared
1,2 $ ?!?@? renames ?
1,2 $ users:me:user set to: [plom]
1,2 $ connection_state set to: [connected]
1,2 $$$ *** Found your hostname (baz.bar.foo)
2 < :*.?.net CAP * LS : foo bar sasl=PLAIN,EXTERNAL baz
-1,2 $ isupport:CHANTYPES set to: [#&]
-1,2 $ isupport:PREFIX set to: [(ov)@+]
2 > CAP REQ :sasl
2 > CAP :LIST
1,2,3,4 $ connection_state set to: [Closing link: (plom@baz.bar.foo) [Quit: ircplom says bye]]
1,2,3,4 $ connection_state set to: []
1,2 $ isupport cleared
+1,2 $ isupport:CHANTYPES set to: [#&]
+1,2 $ isupport:PREFIX set to: [(ov)@+]
1,2 $ motd set to:
1,2 $ sasl_account set to: []
1,2 $ sasl_auth_state set to: []