Package Details: notifymuch-git r39.9d4aaf5-3

Git Clone URL: https://aur.archlinux.org/notifymuch-git.git (read-only, click to copy)
Package Base: notifymuch-git
Description: Display desktop notifications for unread mail in notmuch database
Upstream URL: https://github.com/kspi/notifymuch
Licenses: GPL
Provides: notifymuch
Replaces: notifymuch
Submitter: mathieu.clabaut
Maintainer: mathieu.clabaut
Last Packager: mathieu.clabaut
Votes: 0
Popularity: 0.000000
First Submitted: 2018-04-21 16:37 (UTC)
Last Updated: 2019-09-15 16:12 (UTC)

Latest Comments

zjh commented on 2025-08-26 13:13 (UTC) (edited on 2025-08-26 13:16 (UTC) by zjh)

A patch for the recent version of notmuch

diff --git a/notifymuch/messages.py b/notifymuch/messages.py
index 59223b9..8f1b394 100644
--- a/notifymuch/messages.py
+++ b/notifymuch/messages.py
@@ -2,7 +2,7 @@ from email.utils import parseaddr
 import os
 import time
 import shelve
-import notmuch
+import notmuch2 as notmuch
 from gi.repository import GLib
 from notifymuch import config

@@ -23,7 +23,7 @@ def exclude_recently_seen(messages):
             if now - last_seen[k] > recency_interval:
                 del last_seen[k]
         for message in messages:
-            m_id = message.get_message_id()
+            m_id = message.messageid
             if m_id not in last_seen:
                 last_seen[m_id] = now
                 yield message
@@ -110,24 +110,25 @@ def tags_prefix(tags):

 def summary(messages):
     return '\n'.join('{tags}{subject} ({sender}, {date})'.format(
-                subject=ellipsize(message.get_header('subject')),
-                sender=pretty_sender(message.get_header('from')),
-                date=pretty_date(message.get_date()),
-                tags=tags_prefix(filter_tags(message.get_tags())))
+                subject=ellipsize(message.header('subject')),
+                sender=pretty_sender(message.header('from')),
+                date=pretty_date(message.date),
+                tags=tags_prefix(filter_tags(message.tags)))
             for message in messages)


+
+
 class Messages:
     def __init__(self):
-        db = notmuch.Database()
-        self.query = notmuch.Query(db, config.get('query'))
-        self.query.set_sort(notmuch.Query.SORT.OLDEST_FIRST)
-
+        self.db = notmuch.Database()
+        self.query_str = config.get('query')
+        
     def count(self):
-        return self.query.count_messages()
-
+        return self.db.count_messages(self.query_str)
+        
     def messages(self):
-        return self.query.search_messages()
+        return self.db.messages(self.query_str, sort=self.db.SORT.OLDEST_FIRST)

     def summary(self):
         return summary(self.messages())
@@ -137,3 +138,4 @@ class Messages:

     def unseen_summary(self):
         return summary(self.unseen_messages())
+

mathieu.clabaut commented on 2019-09-15 16:12 (UTC)

Applied. Thanks.

polyzen commented on 2019-09-14 16:59 (UTC)

Cleaned her up a bit: https://paste.xinu.at/ZY9TfS/

weilbith commented on 2018-10-12 12:46 (UTC)

Sry! Haven't seen the update by you and thought I should try out the version before, assuming there it should still work. Now it works! Thank you very much indeed!

mathieu.clabaut commented on 2018-10-12 11:43 (UTC)

The last version is : notifymuch-git r39.9d4aaf5-3

weilbith commented on 2018-10-12 10:36 (UTC) (edited on 2018-10-12 10:48 (UTC) by weilbith)

Confusing... Doesn't work either. Downloaded the last version and installed it. (notifymuch-git-r39.9d4aaf5-2) Same error...

mathieu.clabaut commented on 2018-10-12 09:32 (UTC)

It looks like python-gobject dependency was missing. Can you try with last packages version please ?

weilbith commented on 2018-10-12 08:55 (UTC)

Does not work for me, cause the following error:

Traceback (most recent call last):
  File "/usr/bin/notifymuch", line 33, in <module>
    from notifymuch.notification import show_notification
  File "/usr/lib/python3.7/site-packages/notifymuch/notification.py", line 6, in <module>
    gi.require_version ('Notify', '0.7')
AttributeError: module 'gi' has no attribute 'require_version'

Is this an old gi feature or a new one?