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 423C06DE028C for ; Sun, 17 Nov 2019 10:01:28 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.087 X-Spam-Level: X-Spam-Status: No, score=-0.087 tagged_above=-999 required=5 tests=[AWL=-0.086, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001] 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 W_rOvByvovSP for ; Sun, 17 Nov 2019 10:01:27 -0800 (PST) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by arlo.cworth.org (Postfix) with ESMTPS id 65C736DE0180 for ; Sun, 17 Nov 2019 10:01:27 -0800 (PST) Received: by mail-wm1-f51.google.com with SMTP id q70so14975792wme.1 for ; Sun, 17 Nov 2019 10:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaute-vetsj-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p4NHBMk3uh/2v+3u/XP8EnEI+YRvVkck4rWxHHwHIU0=; b=oxXzkLfABGBlB4mJ13k9zjasBZQucYRgb0EVWt7/SdssJ04bPfU5NzLC7LYRSr5QU4 qdxXTl2PCqUNpeNLCFMGl3zy0IHxVjcPBJsyqkauj7BwXlgvf/PpBQbShZh764KLpNws ZQaI2/zVq1Yao5Gt6AQP42pvFpePiTyHmMioJQPyxwY2g/VHCiej6YW0o/oD/1+3ytDj svPTREUxAPX6wodhp7YilXIjkwftBpU8aZIdM/Os1iJMI21JlmpOSdxcWJHNu30JC7Ed 4aZS0w4sWSOd/iYtOVloUE0zKxJZfBOpPdq5qEnnppYj/AFvuVjlCXdO6U/h8/TCdUi/ e0Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p4NHBMk3uh/2v+3u/XP8EnEI+YRvVkck4rWxHHwHIU0=; b=VnzZq8muSfWHXC4BV7fHmWoCK+8ilF2rHKYpC+vEpyf0M6y6/ACTslhSlMrc6pX6ck tz6+Mh5Z8tQfgyjn8Qda1ARISfHyAsAETsf45KYp3CrE806G3KSeoX8L1oYnLtHbzja8 AeznhvA4hi9YEV8g6fhbdFzTf0ljWTUZZX1/thfd395a4MAZdGGn8WXgw8U3KMMAy26i 9FOBGaBD1BLYaxuTw8J4ITtIfPClQ+BV54ffY5rAIJ3YmMbbohBT8gds3D1LcO1hzvCo d6YN82a4d0XHiUGfap4wmwecJRiRvRBQPrVsThecFdXc1N/jLNk5AhjL8XMFLiC+EZqM oNMQ== X-Gm-Message-State: APjAAAUNwnsUL/MuMEudGe4Q86zpdur7DZF0lIbJzPbNCNt5f79F5qWL ONrlp6ptVAoxjp+vbgCPtRSHCBf2FGC8XCZssFn/eA== X-Google-Smtp-Source: APXvYqw07/gUN2bef7PxGGM7TLrpgb9rH4Ick26BQCWAJy6Q8AhAZoEfKe+jnHE9rV60qfUUpeKh/lB1tsBn6jdE1jQ= X-Received: by 2002:a1c:f612:: with SMTP id w18mr26936562wmc.28.1574013685390; Sun, 17 Nov 2019 10:01:25 -0800 (PST) MIME-Version: 1.0 References: <20191008210312.20685-1-flub@devork.be> <87y2wepgq8.fsf@powell.devork.be> In-Reply-To: <87y2wepgq8.fsf@powell.devork.be> From: Gaute Hope Date: Sun, 17 Nov 2019 19:01:14 +0100 Message-ID: Subject: Re: Python3 cffi bindings To: Floris Bruynooghe Cc: notmuch Content-Type: text/plain; charset="UTF-8" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Sun, 17 Nov 2019 18:01:28 -0000 On Sun, Nov 17, 2019 at 6:14 PM Floris Bruynooghe wrote: > > Hi Gaute, > > Thanks for trying this out! > > On Mon 04 Nov 2019 at 11:27 +0100, Gaute Hope wrote: > > I just checked out the wip/cffi branch on git.notmuch.org with the > > purpose of porting Lieer (https://github.com/gauteh/lieer). There > > seems to be some missing functionality: `Database.get_directory()` > > specifically. > > Yeah, I didn't add that yet because I don't fully understand how it > should be used. Specifically I don't know where one might get a > pathname from to pass to .get_directory() and thus whether the API would > be cleaner to just return a reasonable directory object from whatever > location that might be. Maybe notmuch_database_get_path() is the only > entrypoint here and you can get further by listing files and directories > from it? But maybe people then use the filesystem directly to find a > directory and create the directories ad-hoc. If I understand correctly then these are the directories known to notmuch db, so may not correspond to filesystem. Lieer do not modify Directory objects directly, but others might. > I grepped lieer but I think you only use it in one place? And if I > understand it correctly you only do this to check if your mailstore/cwd > is inside the notmuch database. I.e. this is equivalent to checking if > your mailstore/cwd has notmuch2.Database.path as prefix which you could > easily do directly rather than using the FileError exception from > .get_directory(). Yes, I think that would work here. I need the path of the directory later (for the path:.. query). Seems that the current python API removes the leading path of the database for the argument to notmuch_database_get_directory(..) -- at least if the notmuch API docs are correct. I had some reported issues with symlinked directories and absolute paths, but I don't think any of that would be influenced by changes like these. Regards, Gaute