Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 8A728429E38 for ; Tue, 13 Dec 2011 09:12:12 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oa9F7lZ19Dgn for ; Tue, 13 Dec 2011 09:12:11 -0800 (PST) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id C76B8429E30 for ; Tue, 13 Dec 2011 09:12:09 -0800 (PST) Received: from thor.loria.fr (thor.loria.fr [152.81.12.250]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id 1D81B6A0026; Tue, 13 Dec 2011 18:12:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1323796329; bh=ZCNb4W8qUOOTvM7dXv+9GHmskgUKIuqUjtxCtwcFigY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=GbxkD1oHsqV8L0qnxkRNNSaQoWm2yESyTfCSJMaRlZqp5GTFRwOPMVQCZUF7pSxhc tEXhrADxyYfLEyp9D0jG44xRGC6YJbI1v4ksLefQ0ViTCS+SCwtLwSz8m5/VXU+9LZ e6x+wRg4H1UZqMfhILvijav5K2S2z08pIOPOFFU8= From: Thomas Jost To: notmuch@notmuchmail.org Subject: [PATCH 5/5] python: add get_mtime() to the Message class Date: Tue, 13 Dec 2011 18:11:45 +0100 Message-Id: <1323796305-28789-6-git-send-email-schnouki@schnouki.net> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1323796305-28789-1-git-send-email-schnouki@schnouki.net> References: <1323796305-28789-1-git-send-email-schnouki@schnouki.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2011 17:12:13 -0000 --- bindings/python/notmuch/message.py | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py index ce8e718..56f56c2 100644 --- a/bindings/python/notmuch/message.py +++ b/bindings/python/notmuch/message.py @@ -293,6 +293,10 @@ class Message(object): _get_date.argtypes = [NotmuchMessageP] _get_date.restype = c_long + _get_mtime = nmlib.notmuch_message_get_mtime + _get_mtime.argtypes = [NotmuchMessageP] + _get_mtime.restype = c_long + _get_header = nmlib.notmuch_message_get_header _get_header.argtypes = [NotmuchMessageP, c_char_p] _get_header.restype = c_char_p @@ -401,6 +405,22 @@ class Message(object): raise NotmuchError(STATUS.NOT_INITIALIZED) return Message._get_date(self._msg) + def get_mtime(self): + """Returns time_t of the message mtime + + The mtime is the timestamp of the last time the message was modified, + e.g. the time it was added to the database or the last time a tag was + added or removed. + + :returns: A time_t timestamp. + :rtype: c_unit64 + :exception: :exc:`NotmuchError` STATUS.NOT_INITIALIZED if the message + is not initialized. + """ + if self._msg is None: + raise NotmuchError(STATUS.NOT_INITIALIZED) + return Message._get_mtime(self._msg) + def get_header(self, header): """Get the value of the specified header. -- 1.7.8