From 9588fa3e1f6fa70aa78061337ac51ef973f8e46e Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 23 Aug 2023 22:26:39 +1200 Subject: [PATCH] buildmimetree.py: argparser cleanup --- .config/neomutt/buildmimetree.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.config/neomutt/buildmimetree.py b/.config/neomutt/buildmimetree.py index f7d7c56..c277e63 100755 --- a/.config/neomutt/buildmimetree.py +++ b/.config/neomutt/buildmimetree.py @@ -63,7 +63,7 @@ def parse_cli_args(*args, **kwargs): "--extensions", type=str, default="", - help="Markdown extension to use (comma-separated list)" + help="Markdown extension to use (comma-separated list)", ) parser.add_argument( @@ -85,7 +85,9 @@ def parse_cli_args(*args, **kwargs): ) subp = parser.add_subparsers(help="Sub-command parsers", dest="mode") - massage_p = subp.add_parser("massage", help="Massaging phase (internal use)") + massage_p = subp.add_parser( + "massage", help="Massaging phase (internal use)" + ) massage_p.add_argument( "--write-commands-to", @@ -223,7 +225,12 @@ def collect_inline_images( filewriter_fn(path, data.read(), "w+b") relparts.append( - Part(*mimetype.split("/"), path, cid=info.cid, desc=f"Image: {info.desc}") + Part( + *mimetype.split("/"), + path, + cid=info.cid, + desc=f"Image: {info.desc}", + ) ) return relparts @@ -426,7 +433,13 @@ def do_massage( cmds.flush() extensions = extensions.split(",") if extensions else [] - tree = converter(draft_f.read(), draftpath, tempdir=tempdir, extensions=extensions) + tree = converter( + draft_f.read(), + draftpath, + cssfile=cssfile, + tempdir=tempdir, + extensions=extensions, + ) mimetree = MIMETreeDFWalker(debug=debug_walk) @@ -436,7 +449,7 @@ def do_massage( depth-first, and responsible for telling NeoMutt how to assemble the tree. """ - KILL_LINE=r'\Ca\Ck' + KILL_LINE = r"\Ca\Ck" if isinstance(item, Part): # We've hit a leaf-node, i.e. an alternative or a related part -- 2.39.5