]> 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: make Multipart nodes hashable
authormartin f. krafft <madduck@madduck.net>
Thu, 24 Aug 2023 13:22:23 +0000 (01:22 +1200)
committermartin f. krafft <madduck@madduck.net>
Thu, 24 Aug 2023 13:22:23 +0000 (01:22 +1200)
.config/neomutt/buildmimetree.py

index 02d668bef2cb4ebbee3b26bf4fc66ee32a030757..97ada97a0fe1170686b634d9a25a1e28a89c8d40 100755 (executable)
@@ -252,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: