From: martin f. krafft Date: Tue, 22 Aug 2023 20:40:20 +0000 (+1200) Subject: buildmimetree.py: unified item dscription setting X-Git-Url: https://git.madduck.net/etc/neomutt.git/commitdiff_plain/872d8e0875ecb2da4138e44568c8e715a0f21869?ds=sidebyside;hp=7767b3c3fd519d71c1f90e26c07084ba6b99702d buildmimetree.py: unified item dscription setting --- 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: