]> 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: make Multipart nodes hashable
[etc/neomutt.git] / .config / neomutt / buildmimetree.py
index 0dd18828c36f1140b1a5086e1fe6eb53cac11cfe..97ada97a0fe1170686b634d9a25a1e28a89c8d40 100755 (executable)
@@ -101,8 +101,10 @@ def parse_cli_args(*args, **kwargs):
 
     massage_p.add_argument(
         "--write-commands-to",
+        "-o",
         metavar="PATH",
         dest="cmdpath",
+        required=True,
         help="Temporary file path to write commands to",
     )
 
@@ -250,6 +252,9 @@ class Multipart(
     def __str__(self):
         return f"<multipart/{self.subtype}> children={len(self.children)}"
 
+    def __hash__(self):
+        return hash(str(self.subtype) + "".join(str(self.children)))
+
 
 def filewriter_fn(path, content, mode="w", **kwargs):
     with open(path, mode, **kwargs) as out_f: