From 872d8e0875ecb2da4138e44568c8e715a0f21869 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 23 Aug 2023 08:40:20 +1200 Subject: [PATCH] buildmimetree.py: unified item dscription setting --- .config/neomutt/buildmimetree.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.config/neomutt/buildmimetree.py b/.config/neomutt/buildmimetree.py index 2dac39c..57fc21a 100755 --- a/.config/neomutt/buildmimetree.py +++ b/.config/neomutt/buildmimetree.py @@ -370,8 +370,6 @@ def do_massage( # tree now: if item.cid: cmds.push(f"\\Ca\\Ck{item.cid}") - if item.desc: - cmds.push(f"\\Ca\\Ck{item.desc}") elif isinstance(item, Multipart): # This node has children, but we already visited them (see @@ -385,14 +383,14 @@ def do_massage( elif item.subtype == "multilingual": cmds.push("") - # Again, if there is a description, we might just as well: - if item.desc: - cmds.push(f"\\Ca\\Ck{item.desc}") - else: # We should never get here assert not "is valid part" + # If the item has a description, we might just as well add it + if item.desc: + cmds.push(f"\\Ca\\Ck{item.desc}") + # Finally, if we're at non-root level, tag the new container, # as it might itself be part of a container, to be processed # one level up: -- 2.39.5