]> git.madduck.net Git - etc/neomutt.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

buildmimetree.py: provide a default visitor_fn (debug)
authormartin f. krafft <madduck@madduck.net>
Thu, 24 Aug 2023 13:25:49 +0000 (01:25 +1200)
committermartin f. krafft <madduck@madduck.net>
Thu, 24 Aug 2023 13:25:49 +0000 (01:25 +1200)
.config/neomutt/buildmimetree.py

index e2a23a741bbee012d1fd42c6eecf3fbc5fcef7e6..4ab7a5488055c624baee9b91f8ba8fd63b664fa6 100755 (executable)
@@ -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