From: Christian Heller Date: Thu, 20 Nov 2025 08:47:01 +0000 (+0100) Subject: For update loggings, differentiate Dict zero-ing vs other emptyings. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/calendar?a=commitdiff_plain;h=4d0e12080fb147a8afba885c9d925309bb1319e7;p=ircplom For update loggings, differentiate Dict zero-ing vs other emptyings. --- diff --git a/src/ircplom/client_tui.py b/src/ircplom/client_tui.py index ef62f57..a04bca4 100644 --- a/src/ircplom/client_tui.py +++ b/src/ircplom/client_tui.py @@ -233,7 +233,9 @@ class _UpdatingNode(AutoAttrMixin): result = (tuple(sorted(update.value)) if isinstance(update.value, set) else update.value) announcement = ':' + ':'.join(update.full_path) + ' ' - if result in (None, tuple()): + if result == tuple(): + announcement += 'emptied' + elif result is None: announcement += 'cleared' else: announcement += 'set to: ' diff --git a/src/tests/channels.test b/src/tests/channels.test index 53b2b5e..c44349e 100644 --- a/src/tests/channels.test +++ b/src/tests/channels.test @@ -20,7 +20,7 @@ insert ./lib/user-set-to insert ./lib/usermode × part-empty -insert part : + USERIDS_CLEAR :cleared +insert part : + USERIDS_CLEAR :emptied × topic-set-to log 1 $ channels:CHANNEL:topic set to: [Topic(what='NEWTOPIC', who=NickUserHost(nick='baz', user='~baz', host='baz.baz'))] diff --git a/src/tests/test.test b/src/tests/test.test index a029efe..b5209b5 100644 --- a/src/tests/test.test +++ b/src/tests/test.test @@ -163,10 +163,10 @@ insert no-handler : +0 ALERT_WIN_IDS=2,3,4,5,6,7 ? :foo bar baz # handle /disconnect, clear all insert cmd-disconnect-0 :-1 log 3,6,7 $ foo!~baz@baz.bar.foo quits: Client Quit -insert quits : + CHAN_WIN_ID=5 CHANNEL=#testtest USER_ID=me NICK=foo foo@foo.foo=baz@baz.bar.foo USERIDS_CLEAR :cleared +insert quits : + CHAN_WIN_ID=5 CHANNEL=#testtest USER_ID=me NICK=foo foo@foo.foo=baz@baz.bar.foo USERIDS_CLEAR :emptied insert cmd-disconnect-1 : +0 insert disconnect1 :-1 +1 WIN_IDS :2,3,4,5,6,7 -log 1 $ motd cleared +log 1 $ motd emptied log 1 $ users cleared # fail to send in disconnect, check alert window is command prompt window