Re: nbook: a notmuch based address book written in python
authorSuvayu Ali <fatkasuvayu+linux@gmail.com>
Mon, 8 Oct 2012 09:34:29 +0000 (11:34 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:44 +0000 (09:49 -0800)
87/04b977b3f994d4c2cf24f073be4bb1f3f7b199 [new file with mode: 0644]

diff --git a/87/04b977b3f994d4c2cf24f073be4bb1f3f7b199 b/87/04b977b3f994d4c2cf24f073be4bb1f3f7b199
new file mode 100644 (file)
index 0000000..4135573
--- /dev/null
@@ -0,0 +1,165 @@
+Return-Path: <fatkasuvayu+linux@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2224E431FB6\r
+       for <notmuch@notmuchmail.org>; Mon,  8 Oct 2012 02:34:37 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id kYvVl-VLcJZm for <notmuch@notmuchmail.org>;\r
+       Mon,  8 Oct 2012 02:34:36 -0700 (PDT)\r
+Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
+ [74.125.83.53])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 4632E431FAF   for <notmuch@notmuchmail.org>; Mon,  8 Oct 2012 02:34:36 -0700\r
+ (PDT)\r
+Received: by mail-ee0-f53.google.com with SMTP id d17so2924031eek.26\r
+       for <notmuch@notmuchmail.org>; Mon, 08 Oct 2012 02:34:33 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=sender:date:from:to:subject:message-id:mail-followup-to:references\r
+       :mime-version:content-type:content-disposition:in-reply-to\r
+       :user-agent; bh=yKYkBjAlJR0x3VvvuEd+AeBlUo1yQIrRc/jzj+DChjM=;\r
+       b=ZjSdY8rWQWhZb8HjqPyR+18RmD8zsG8LM9O6HRHWk6+KqBHl5uinrDZiqBzrjcO61r\r
+       +e+iQ/8wxX/iRp4xEurGgfEOKIOJ5JASJzWv5jdPMB7ZDPMFerb96kPBobmsoQ8LDGd2\r
+       kCufFyEZtsMCojiOxT7WLmPBS14MGGFNiIxb1Imfx04ocTQJuEtPvM6EOOWQVmq3tnZ9\r
+       P6dNq/UeBs+QUkVa8S7uX8ozB6SbZ+OMtoxMeaAV4XCoEsomeVap4mnqN6w0XqjqNbvK\r
+       SGO+Nn5HSiPnR27KdTR47J3SbhqGbtKJWtrxxd/Jg501oStX7Pr0ANDTVQ/zXb1+xWuL\r
+       8e4Q==\r
+Received: by 10.14.202.131 with SMTP id d3mr21893463eeo.32.1349688873653;\r
+       Mon, 08 Oct 2012 02:34:33 -0700 (PDT)\r
+Received: from kuru.dyndns-at-home.com (pb-d-128-141-52-183.cern.ch.\r
+       [128.141.52.183])\r
+       by mx.google.com with ESMTPS id r45sm28828615eem.6.2012.10.08.02.34.32\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 08 Oct 2012 02:34:32 -0700 (PDT)\r
+Sender: suvayu ali <fatkasuvayu@gmail.com>\r
+Date: Mon, 8 Oct 2012 11:34:29 +0200\r
+From: Suvayu Ali <fatkasuvayu+linux@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: nbook: a notmuch based address book written in python\r
+Message-ID: <20121008093429.GC4534@kuru.dyndns-at-home.com>\r
+Mail-Followup-To: notmuch@notmuchmail.org\r
+References: <20120924082646.GA10577@kuru.dyndns-at-home.com>\r
+       <20120925104457.12264.30350@megatron>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <20120925104457.12264.30350@megatron>\r
+User-Agent: Mutt/1.5.21 (2011-07-01)\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 08 Oct 2012 09:34:38 -0000\r
+\r
+Hi Patrick,\r
+\r
+Sorry for the very late reply; I got distracted with some personal\r
+matters.\r
+\r
+On Tue, Sep 25, 2012 at 11:44:57AM +0100, Patrick Totzke wrote:\r
+> Hey Suvayu, welcome to notmuch!\r
+> \r
+> I hope you are aware that there are already a few search based abook tools\r
+> around for notmuch (listed in the wiki, albeit hidden in the emacs docs):\r
+> http://notmuchmail.org/emacstips/#index14h2\r
+> I personally use nottoomuch-addresses.sh, which apparently does some advanced\r
+> caching voodoo for speed.\r
+> \r
+\r
+I wasn't aware of either of them, thanks for pointing them out.  I'll\r
+take a look for inspiration and ideas.\r
+\r
+> But to your tool; practice test:\r
+> I wasn't able to use wildcards or simply prefixes of names. This is essential\r
+> if you want to use it for tabcompleting contacts in a MUA.\r
+\r
+Since the idea was inspired by the completion on the Gmail web\r
+interface, I already do a partial search so wildcards should not be\r
+necessary.\r
+\r
+> The time lookups take seems to depend on how many matches there are:\r
+> \r
+> -------------------------------\r
+> time nbook Suvayu\r
+> 1 unique email addresses found for `Suvayu'\r
+> fatkasuvayu+linux@gmail.com     Suvayu Ali\r
+> \r
+> nbook Suvayu  0.04s user 0.01s system 95% cpu 0.050 total\r
+> -------------------------------\r
+> time nbook Justus\r
+> ...\r
+> \r
+> nbook Justus  0.21s user 0.07s system 11% cpu 2.484 total\r
+> -------------------------------\r
+\r
+Yes, I noticed this too when I searched for the more common names.  Not\r
+sure how to get around this though.\r
+\r
+> And If I look for my own name, this takes over a minute,\r
+> eventually dying. This could be an issue with libnotmuch though.\r
+> Possibly, your algorithm takes very long and then reads from an initially\r
+> opened Database object again, which was invalidated by concurrent writes of other processes..\r
+> \r
+> -------------------------------\r
+> [~] time nbook Patrick                     \r
+> \r
+> 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\r
+> Traceback (most recent call last):\r
+>   File "/home/pazz/bin/nbook", line 167, in <module>\r
+>   File "/home/pazz/bin/nbook", line 71, in __init__\r
+>   File "/home/pazz/.local/lib/python2.7/site-packages/notmuch/message.py", line 233, in get_header\r
+> notmuch.errors.NullPointerError\r
+> Error in sys.excepthook:\r
+> Traceback (most recent call last):\r
+>   File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook\r
+> ImportError: No module named fileutils\r
+> \r
+> Original exception was:\r
+> Traceback (most recent call last):\r
+>   File "/home/pazz/bin/nbook", line 167, in <module>\r
+>   File "/home/pazz/bin/nbook", line 71, in __init__\r
+>   File "/home/pazz/.local/lib/python2.7/site-packages/notmuch/message.py", line 233, in get_header\r
+> notmuch.errors.NullPointerError\r
+> nbook Patrick  3.20s user 5.47s system 12% cpu 1:11.65 total\r
+> ------------------------------------\r
+> \r
+\r
+Yes someone else pointed this out too.  Again I'm not sure how to\r
+proceed here.  I had a quick look at this last week and it seemed to me\r
+the limitation comes from within the python bindings for notmuch.  Do\r
+you have any ideas?\r
+\r
+> Anyway, have fun hacking notmuch! If you are looking for a related project to bring in your python skills\r
+> I could think of one or two :D\r
+\r
+That would be wonderful.  To give you my background, I'm a graduate\r
+student in physics and I have to do a lot of C/C++ and python\r
+programming for my research.  Contributing to FOSS projects seems like a\r
+wonderful way to learn to collaborate and clean programming (we\r
+physicists tend to be sloppy programmers :-p).\r
+\r
+> Best,\r
+> /p\r
+\r
+Cheers,\r
+\r
+-- \r
+Suvayu\r
+\r
+Open source is the future. It sets us free.\r