Re: [PATCH v2] add notmuch.Database.get_status_string()
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 10 Dec 2015 02:18:17 +0000 (21:18 +1900)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:50:08 +0000 (14:50 -0700)
c1/97fb613ee905afeb8fe8b666907b42cd55531c [new file with mode: 0644]

diff --git a/c1/97fb613ee905afeb8fe8b666907b42cd55531c b/c1/97fb613ee905afeb8fe8b666907b42cd55531c
new file mode 100644 (file)
index 0000000..5954a32
--- /dev/null
@@ -0,0 +1,103 @@
+Return-Path: <dkg@fifthhorseman.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 4F3576DE1603\r
+ for <notmuch@notmuchmail.org>; Wed,  9 Dec 2015 18:18:22 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.039\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.039 tagged_above=-999 required=5\r
+ tests=[AWL=-0.039] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id fmqKl7Oe_AFY for <notmuch@notmuchmail.org>;\r
+ Wed,  9 Dec 2015 18:18:20 -0800 (PST)\r
+Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 08D066DE005F\r
+ for <notmuch@notmuchmail.org>; Wed,  9 Dec 2015 18:18:19 -0800 (PST)\r
+Received: from fifthhorseman.net (unknown [38.109.115.130])\r
+ by che.mayfirst.org (Postfix) with ESMTPSA id 482D5F984\r
+ for <notmuch@notmuchmail.org>; Wed,  9 Dec 2015 21:18:17 -0500 (EST)\r
+Received: by fifthhorseman.net (Postfix, from userid 1000)\r
+ id 6D7C22006D; Wed,  9 Dec 2015 21:18:17 -0500 (EST)\r
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v2] add notmuch.Database.get_status_string()\r
+In-Reply-To: <1449713800-25608-1-git-send-email-dkg@fifthhorseman.net>\r
+References: <1449713573-25316-1-git-send-email-dkg@fifthhorseman.net>\r
+ <1449713800-25608-1-git-send-email-dkg@fifthhorseman.net>\r
+User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Wed, 09 Dec 2015 21:18:17 -0500\r
+Message-ID: <87wpsnm4gm.fsf@alice.fifthhorseman.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 10 Dec 2015 02:18:22 -0000\r
+\r
+Sorry about the first version, which didn't handle a NULL value\r
+properly.  Please only consider this v2 version.\r
+\r
+           --dkg\r
+\r
+On Wed 2015-12-09 21:16:40 -0500, Daniel Kahn Gillmor wrote:\r
+> This gives some additional access to debugging information when using\r
+> the python bindings.\r
+> ---\r
+>  bindings/python/notmuch/database.py | 16 ++++++++++++++++\r
+>  1 file changed, 16 insertions(+)\r
+>\r
+> diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py\r
+> index 5b58e09..d29c292 100644\r
+> --- a/bindings/python/notmuch/database.py\r
+> +++ b/bindings/python/notmuch/database.py\r
+> @@ -114,6 +114,11 @@ class Database(object):\r
+>      _get_all_tags.argtypes = [NotmuchDatabaseP]\r
+>      _get_all_tags.restype = NotmuchTagsP\r
+>  \r
+> +    """notmuch_database_status_string"""\r
+> +    _get_status_string = nmlib.notmuch_database_status_string\r
+> +    _get_status_string.argtypes = [NotmuchDatabaseP]\r
+> +    _get_status_string.restype = c_char_p\r
+> +\r
+>      """notmuch_database_create"""\r
+>      _create = nmlib.notmuch_database_create\r
+>      _create.argtypes = [c_char_p, POINTER(NotmuchDatabaseP)]\r
+> @@ -575,6 +580,17 @@ class Database(object):\r
+>          """\r
+>          return Query(self, querystring)\r
+>  \r
+> +    def get_status_string(self):\r
+> +        """Returns the status string of the database\r
+> +\r
+> +        This is sometimes used for additional error reporting\r
+> +        """\r
+> +        self._assert_db_is_initialized()\r
+> +        s = Database._get_status_string(self._db)\r
+> +        if s:\r
+> +            return s.decode('utf-8', 'ignore')\r
+> +        return s\r
+> +\r
+>      def __repr__(self):\r
+>          return "'Notmuch DB " + self.get_path() + "'"\r
+>  \r
+> -- \r
+> 2.6.2\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> https://notmuchmail.org/mailman/listinfo/notmuch\r