From: Suvayu Ali Date: Mon, 15 Oct 2012 11:52:40 +0000 (+0200) Subject: Re: nbook: a notmuch based address book written in python X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=3168440566cacff3f4549e7899bf2118881b745e;p=notmuch-archives.git Re: nbook: a notmuch based address book written in python --- diff --git a/80/71b319d90e031a7d763dc794560bb6e7657376 b/80/71b319d90e031a7d763dc794560bb6e7657376 new file mode 100644 index 000000000..e200276fe --- /dev/null +++ b/80/71b319d90e031a7d763dc794560bb6e7657376 @@ -0,0 +1,150 @@ +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 3A703431FAE + for ; Mon, 15 Oct 2012 04:53:04 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 F2Osn258XL35 for ; + Mon, 15 Oct 2012 04:53:01 -0700 (PDT) +Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com + [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 6AABF431FBF + for ; Mon, 15 Oct 2012 04:53:01 -0700 (PDT) +Received: by mail-wi0-f179.google.com with SMTP id hq7so1565567wib.2 + for ; Mon, 15 Oct 2012 04:53:00 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=sender:date:from:to:subject:message-id:mail-followup-to:references + :mime-version:content-type:content-disposition:in-reply-to + :user-agent; bh=djoTC6iyWWwoQeh7XeKRMDaVh0Wbchs0UEzWkfX1po8=; + b=T7KRJWVbZhrnwjBcdxSA/XVYC0daqrX3xG2cu9PUt6ft0ICgqgsSDeL7ZUdURpKfSl + HFThailY0DqHhAfy7rrO3gDhU6h8F32lm2wDYD3822Hfe5cXB8Tp7G6PlmNgxhMPR5T5 + oyAHf3hQgqUvcmV5nRDdJvRMVc5h21+RNEv2MNeft/33IFI0SVKI0+1us6U2Y+WzCMli + Oz/ZEK6ewb4q76LUNLQhpB7+Tkgccyic2OzcoBxlTNCHd0dDMY76tI/ZLCPK6za/hWM0 + OObUkJHS+sYho2gJEtCXW9K9Lm0lksxX76m1VwTj7jqdrVK+IjDuUufV+/QQ7vCMbvkw + 0MrA== +Received: by 10.216.198.16 with SMTP id u16mr7493858wen.115.1350301980021; + Mon, 15 Oct 2012 04:53:00 -0700 (PDT) +Received: from kuru.dyndns-at-home.com (pb-d-128-141-52-158.cern.ch. + [128.141.52.158]) + by mx.google.com with ESMTPS id k20sm13632532wiv.11.2012.10.15.04.52.42 + (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 15 Oct 2012 04:52:43 -0700 (PDT) +Sender: suvayu ali +Date: Mon, 15 Oct 2012 13:52:40 +0200 +From: Suvayu Ali +To: notmuch@notmuchmail.org +Subject: Re: nbook: a notmuch based address book written in python +Message-ID: <20121015115240.GA14067@kuru.dyndns-at-home.com> +Mail-Followup-To: notmuch@notmuchmail.org +References: <20120924082646.GA10577@kuru.dyndns-at-home.com> + <20120925104457.12264.30350@megatron> + <20121008093429.GC4534@kuru.dyndns-at-home.com> + <20121013165851.29671.29869@brick.lan> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20121013165851.29671.29869@brick.lan> +User-Agent: Mutt/1.5.21 (2011-07-01) +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: Mon, 15 Oct 2012 11:53:04 -0000 + +Hello Patrick, + +On Sat, Oct 13, 2012 at 05:58:51PM +0100, Patrick Totzke wrote: +> Quoting Suvayu Ali (2012-10-08 10:34:29) +> > +> > > But to your tool; practice test: +> > > I wasn't able to use wildcards or simply prefixes of names. This is essential +> > > if you want to use it for tabcompleting contacts in a MUA. +> > +> > Since the idea was inspired by the completion on the Gmail web +> > interface, I already do a partial search so wildcards should not be +> > necessary. +> +> Not sure what you mean here: If I compose a mail using gmails web interface +> and type a prefix of someone's name I will get this contect as a suggestion. +> My point was that using your tool, I did not get a contact suggested +> for all prefixes. +> + +What I meant was, I search for ** in the name or email address +strings. So adding a glob character is not needed; in fact adding it +would mean my algorithm would search for a literal "*" and fail. + +[...] + +> +> I think this is a conceptual problem with your algorithm: +> You look up *all* messages and add a name to your result-list +> if it matches. This means you go through some condidate +> as often as you index contains mails from/to him. +> What one really wants is to ask the database to do something like +> "SELECT name,email from RECIPIENTS_OR_SENDER" +> where RECIPIENTS_OR_SENDER is some imaginary list that stores +> a set of contacts. +> +> Bottom line: One would have to change the layout of the underlying +> database (not likely) or do regularly update some cache +> and only work on that. This is what some of the mentioned tools do if i'm not mistaken. +> + +Yes, you are right. I realised this too when I tried out +nottoomuch-address a few days back. Caching seems to be the solution +for performance issues. + +[...] + +> > > ------------------------------- +> > > [~] time nbook Patrick +> > > +> > > Error opening /home/pazz/mail/gmail/[Google Mail].All Mail/cur/1330682270_0.12958.megatron,U=8766,FMD5=66ff6a8bc18a8a3ac4b311daa93d358a:2,S: Too many open files +> > > Traceback (most recent call last): +> > > File "/home/pazz/bin/nbook", line 167, in +> > > File "/home/pazz/bin/nbook", line 71, in __init__ +> > > File "/home/pazz/.local/lib/python2.7/site-packages/notmuch/message.py", line 233, in get_header +> > > notmuch.errors.NullPointerError + +[...] + +I see in the meantime I was writing this email, Justus gave an +explanation for the issue; I'll go through the response carefully. + +> +> https://github.com/teythoon/afew +> https://github.com/pazz/alot +> http://excess.org/urwid/ +> +> I'm sure patches will be welcome to any of the above :) + +Al 3 seem very interesting, but I think I will take a closer look at +afew and urwid. + +Thanks for the pointers, + +:) + +-- +Suvayu + +Open source is the future. It sets us free.