From 62b59db8d6b721c9cb37eeb471ba3284fd7fe45f Mon Sep 17 00:00:00 2001 From: enkore Date: Fri, 22 Feb 2013 18:16:39 +0100 Subject: [PATCH] Fixed issue #9 Notmuch checker does not work in this state NotmuchMailChecker does not work because of a conflict between the notmuch Python API and the file for NotmuchMailChecker which is also named notmuch. I suggest to rename i3pystatus/notmuch.py to i3pystatus/notmuchchecker.py and modify main.py.dist appropriately. Reported by mjepronk Also removed some superfluous whitespace --- i3pystatus/__main__.py.dist | 4 ++-- i3pystatus/{notmuch.py => notmuchmail.py} | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename i3pystatus/{notmuch.py => notmuchmail.py} (97%) diff --git a/i3pystatus/__main__.py.dist b/i3pystatus/__main__.py.dist index 1db9380..bd27f2b 100755 --- a/i3pystatus/__main__.py.dist +++ b/i3pystatus/__main__.py.dist @@ -5,7 +5,7 @@ from i3pystatus import ( I3statusHandler, mailchecker, modsde, - notmuch, + notmuchmail, thunderbird, regex, ) @@ -62,7 +62,7 @@ status.register(mde) # the notmuch mail checker module db_path = "path_to_your_notmuch_database" -nm = notmuch.NotmuchMailChecker(db_path) +nm = notmuchmail.NotmuchMailChecker(db_path) status.register(nm) diff --git a/i3pystatus/notmuch.py b/i3pystatus/notmuchmail.py similarity index 97% rename from i3pystatus/notmuch.py rename to i3pystatus/notmuchmail.py index 99ff26d..ccf7032 100644 --- a/i3pystatus/notmuch.py +++ b/i3pystatus/notmuchmail.py @@ -9,12 +9,12 @@ import json from i3pystatus import IntervalModule class NotmuchMailChecker(IntervalModule): - """ + """ This class uses the notmuch python bindings to check for the number of messages in the notmuch database with the tags "inbox" and "unread" """ - + db_path = "" def __init__(self, db_path): @@ -23,7 +23,7 @@ class NotmuchMailChecker(IntervalModule): def run(self): db = notmuch.Database(self.db_path) unread = notmuch.Query(db, "tag:unread and tag:inbox").count_messages() - + if (unread == 0): color = "#00FF00" urgent = "false"