From: martin f. krafft Date: Thu, 24 Aug 2023 13:25:49 +0000 (+1200) Subject: buildmimetree.py: provide a default visitor_fn (debug) X-Git-Url: https://git.madduck.net/etc/neomutt.git/commitdiff_plain/9e8410fe71ea97c659ff61647598495a5a0e03ee?ds=inline;hp=00a8a4417bbed5a609adb33039f47d711fd0e404 buildmimetree.py: provide a default visitor_fn (debug) --- diff --git a/.config/neomutt/buildmimetree.py b/.config/neomutt/buildmimetree.py index e2a23a7..4ab7a54 100755 --- a/.config/neomutt/buildmimetree.py +++ b/.config/neomutt/buildmimetree.py @@ -339,9 +339,12 @@ def convert_markdown_to_html( class MIMETreeDFWalker: def __init__(self, *, visitor_fn=None, debug=False): - self._visitor_fn = visitor_fn + self._visitor_fn = visitor_fn or self._echovisit self._debug = debug + def _echovisit(self, node, ancestry, debugprint): + debugprint(f"node={node} ancestry={ancestry}") + def walk(self, root, *, visitor_fn=None): """ Recursive function to implement a depth-dirst walk of the MIME-tree