From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id C75BB6DE098B for ; Thu, 16 Nov 2017 08:12:31 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.115 X-Spam-Level: X-Spam-Status: No, score=0.115 tagged_above=-999 required=5 tests=[AWL=-0.105, RDNS_NONE=0.2, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aWF0N0n7IVmE for ; Thu, 16 Nov 2017 08:12:26 -0800 (PST) Received: from fethera.tethera.net (unknown [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 979AE6DE0B0A for ; Thu, 16 Nov 2017 08:12:08 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1eFJru-00081R-FM; Thu, 16 Nov 2017 08:06:10 -0500 Received: (nullmailer pid 30591 invoked by uid 1000); Thu, 16 Nov 2017 13:06:09 -0000 From: David Bremner To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH 18/18] python: add try_decrypt argument to Database.index_file() In-Reply-To: <20171025065203.24403-19-dkg@fifthhorseman.net> References: <20171025065203.24403-1-dkg@fifthhorseman.net> <20171025065203.24403-19-dkg@fifthhorseman.net> Date: Thu, 16 Nov 2017 09:06:09 -0400 Message-ID: <87o9o28jb2.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Thu, 16 Nov 2017 16:12:31 -0000 Daniel Kahn Gillmor writes: > @@ -454,10 +487,19 @@ class Database(object): > :attr:`STATUS`.READ_ONLY_DATABASE > Database was opened in read-only mode so no message can > be added. > + looks like a random blank line > """ > self._assert_db_is_initialized() > msg_p = NotmuchMessageP() > - status = self._index_file(self._db, _str(filename), c_void_p(None), byref(msg_p)) > + indexopts = c_void_p(None) > + if try_decrypt is not None: > + indexopts = self._get_default_indexopts(self._db) > + self._indexopts_set_try_decrypt(indexopts, try_decrypt) > + > + status = self._index_file(self._db, _str(filename), indexopts, byref(msg_p)) > + > + if indexopts: > + self._indexopts_destroy(indexopts) > > if not status in [STATUS.SUCCESS, STATUS.DUPLICATE_MESSAGE_ID]: > raise NotmuchError(status) > diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py > index b1eec2cf..71426c84 100644 > --- a/bindings/python/notmuch/globals.py > +++ b/bindings/python/notmuch/globals.py > @@ -88,3 +88,8 @@ NotmuchDirectoryP = POINTER(NotmuchDirectoryS) > class NotmuchFilenamesS(Structure): > pass > NotmuchFilenamesP = POINTER(NotmuchFilenamesS) > + > + > +class NotmuchIndexoptsS(Structure): > + pass > +NotmuchIndexoptsP = POINTER(NotmuchIndexoptsS) > -- > 2.14.2 I think this new bindings functionality needs a test.