From 48aae7381e8b59e886925df841bd5a0f0f513fd9 Mon Sep 17 00:00:00 2001 From: Patrick Totzke Date: Tue, 25 Sep 2012 11:44:57 +0100 Subject: [PATCH] Re: nbook: a notmuch based address book written in python --- 52/94c19b3f66a89104046fb4c08deabe92f40cc0 | 133 ++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 52/94c19b3f66a89104046fb4c08deabe92f40cc0 diff --git a/52/94c19b3f66a89104046fb4c08deabe92f40cc0 b/52/94c19b3f66a89104046fb4c08deabe92f40cc0 new file mode 100644 index 000000000..375956394 --- /dev/null +++ b/52/94c19b3f66a89104046fb4c08deabe92f40cc0 @@ -0,0 +1,133 @@ +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 9FFE9431FC7 + for ; Tue, 25 Sep 2012 03:44:59 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.7 +X-Spam-Level: * +X-Spam-Status: No, score=1.7 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, 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 OMbdXNDY-8Dv for ; + Tue, 25 Sep 2012 03:44:59 -0700 (PDT) +Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com + [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id EB332431FAF + for ; Tue, 25 Sep 2012 03:44:58 -0700 (PDT) +Received: by wiwc10 with SMTP id c10so2239431wiw.2 + for ; Tue, 25 Sep 2012 03:44:56 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=content-type:mime-version:content-transfer-encoding:from:user-agent + :to:references:in-reply-to:message-id:subject:date; + bh=NbanrR4/4wWjPyTlmDO0dCxKwECl6V7xboOuSt5PR9o=; + b=d/T1WzCM8yItroLEm4U13yNakdZOGhtkgb5ccolZsY453v4HsSnBfze+dbLfNcgt5n + UUIQySU2ekf6hc12CEqg2IrAgnDCsiaMe3j/GrKBU708Y5u+6CExlo64xTi4YiOhW5uY + GYsKrvfnlqMG9RvBEoV6vTKJOlbIui+PULNvNv2gLiIo9NqqPuoKeJqiP/PVLFKBxSUf + pGSEGidMd3NDG9U9dKQCahPg2GcSaa0VTzKI+eE0ogZybKQWGH3BYtY8cnrxNgISt98a + 0N3wGw2F6tokDv7vvsV+9eig7b3AX3bXH23OWvt3M0utnBypxTKfiaN3rIAkUhxVtrVf + dpoA== +Received: by 10.216.202.133 with SMTP id d5mr4743023weo.63.1348569896301; + Tue, 25 Sep 2012 03:44:56 -0700 (PDT) +Received: from localhost (dhcp-91-036.inf.ed.ac.uk. [129.215.91.36]) + by mx.google.com with ESMTPS id do5sm22237246wib.10.2012.09.25.03.44.55 + (version=TLSv1/SSLv3 cipher=OTHER); + Tue, 25 Sep 2012 03:44:55 -0700 (PDT) +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +From: Patrick Totzke +User-Agent: alot/0.3.3+ +To: Suvayu Ali , notmuch@notmuchmail.org +References: <20120924082646.GA10577@kuru.dyndns-at-home.com> +In-Reply-To: <20120924082646.GA10577@kuru.dyndns-at-home.com> +Message-ID: <20120925104457.12264.30350@megatron> +Subject: Re: nbook: a notmuch based address book written in python +Date: Tue, 25 Sep 2012 11:44:57 +0100 +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, 25 Sep 2012 10:44:59 -0000 + +Hey Suvayu, welcome to notmuch! + +I hope you are aware that there are already a few search based abook tools +around for notmuch (listed in the wiki, albeit hidden in the emacs docs): +http://notmuchmail.org/emacstips/#index14h2 +I personally use nottoomuch-addresses.sh, which apparently does some advanc= +ed +caching voodoo for speed. + +But to your tool; practice test: +I wasn't able to use wildcards or simply prefixes of names. This is essenti= +al +if you want to use it for tabcompleting contacts in a MUA. +The time lookups take seems to depend on how many matches there are: + +------------------------------- +time nbook Suvayu +1 unique email addresses found for `Suvayu' +fatkasuvayu+linux@gmail.com Suvayu Ali + +nbook Suvayu 0.04s user 0.01s system 95% cpu 0.050 total +------------------------------- +time nbook Justus +... + +nbook Justus 0.21s user 0.07s system 11% cpu 2.484 total +------------------------------- +And If I look for my own name, this takes over a minute, +eventually dying. This could be an issue with libnotmuch though. +Possibly, your algorithm takes very long and then reads from an initially +opened Database object again, which was invalidated by concurrent writes of= + other processes.. + +------------------------------- +[~] time nbook Patrick = + + +Error opening /home/pazz/mail/gmail/[Google Mail].All Mail/cur/1330682270_0= +.12958.megatron,U=3D8766,FMD5=3D66ff6a8bc18a8a3ac4b311daa93d358a:2,S: Too m= +any 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 +Error in sys.excepthook: +Traceback (most recent call last): + File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, i= +n apport_excepthook +ImportError: No module named fileutils + +Original exception was: +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 +nbook Patrick 3.20s user 5.47s system 12% cpu 1:11.65 total +------------------------------------ + +Anyway, have fun hacking notmuch! If you are looking for a related project = +to bring in your python skills +I could think of one or two :D +Best, +/p -- 2.26.2