]> git.madduck.net Git - etc/neomutt.git/blobdiff - .config/neomutt/buildmimetree.py

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: argparser cleanup
[etc/neomutt.git] / .config / neomutt / buildmimetree.py
index f7d7c56b8f8861aa6b327821dc0ba9f0fb5058f7..c277e6344477f5fa025eebf36176c22dfeb26046 100755 (executable)
@@ -63,7 +63,7 @@ def parse_cli_args(*args, **kwargs):
         "--extensions",
         type=str,
         default="",
         "--extensions",
         type=str,
         default="",
-        help="Markdown extension to use (comma-separated list)"
+        help="Markdown extension to use (comma-separated list)",
     )
 
     parser.add_argument(
     )
 
     parser.add_argument(
@@ -85,7 +85,9 @@ def parse_cli_args(*args, **kwargs):
     )
 
     subp = parser.add_subparsers(help="Sub-command parsers", dest="mode")
     )
 
     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",
 
     massage_p.add_argument(
         "--write-commands-to",
@@ -223,7 +225,12 @@ def collect_inline_images(
         filewriter_fn(path, data.read(), "w+b")
 
         relparts.append(
         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
         )
 
     return relparts
@@ -426,7 +433,13 @@ def do_massage(
     cmds.flush()
 
     extensions = extensions.split(",") if extensions else []
     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)
 
 
     mimetree = MIMETreeDFWalker(debug=debug_walk)
 
@@ -436,7 +449,7 @@ def do_massage(
         depth-first, and responsible for telling NeoMutt how to assemble
         the tree.
         """
         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
 
         if isinstance(item, Part):
             # We've hit a leaf-node, i.e. an alternative or a related part