unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Patrick Totzke <patricktotzke@gmail.com>
To: Suvayu Ali <fatkasuvayu+linux@gmail.com>,  notmuch@notmuchmail.org
Subject: Re: nbook: a notmuch based address book written in python
Date: Tue, 25 Sep 2012 11:44:57 +0100	[thread overview]
Message-ID: <20120925104457.12264.30350@megatron> (raw)
In-Reply-To: <20120924082646.GA10577@kuru.dyndns-at-home.com>

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 advanced
caching voodoo for speed.

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.
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=8766,FMD5=66ff6a8bc18a8a3ac4b311daa93d358a:2,S: Too many open files
Traceback (most recent call last):
  File "/home/pazz/bin/nbook", line 167, in <module>
  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, in apport_excepthook
ImportError: No module named fileutils

Original exception was:
Traceback (most recent call last):
  File "/home/pazz/bin/nbook", line 167, in <module>
  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

  reply	other threads:[~2012-09-25 10:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24  8:26 nbook: a notmuch based address book written in python Suvayu Ali
2012-09-25 10:44 ` Patrick Totzke [this message]
2012-10-08  9:34   ` Suvayu Ali
2012-10-13 16:58     ` Patrick Totzke
2012-10-15 10:58       ` Justus Winter
2012-10-16 14:55         ` Suvayu Ali
2012-10-15 11:52       ` Suvayu Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120925104457.12264.30350@megatron \
    --to=patricktotzke@gmail.com \
    --cc=fatkasuvayu+linux@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).