problem with folder: search in python bindings

2011-03-22 Thread Sebastian Spaeth
On Mon, 21 Mar 2011 11:01:24 -0700, Jameson Rollins  wrote:
> Oh good call, Jesse.  Bonus points for you!  That was the problem.  Damn
> it.  In retrospect that's so obvious, though, isn't it!  I had purged
> the notmuch binary package, but had accidentally left libnotmuch1 and
> libnotmuch-dev installed.  Removing those packages and pointing to my
> locally installed libraries fixed the problem.

Pfeww, I was getting very scared that the python bindings have serious
flaws that I am not aware of. Don't ever do that again to me :-).

Glad you could sort it out. Unfortunately it is not easy to tease out
the path of the libnotmuch being used, otherwise we could debug-output
it.

Sebastian
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 



problem with folder: search in python bindings

2011-03-22 Thread Jameson Rollins
On Tue, 22 Mar 2011 10:35:17 +0100, Sebastian Spaeth  
wrote:
> Pfeww, I was getting very scared that the python bindings have serious
> flaws that I am not aware of. Don't ever do that again to me :-).

In the future, we should make sure that all new features are included
since the beginning.  That way we'll avoid all future library
incompatibilities.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



Re: problem with folder: search in python bindings

2011-03-22 Thread Sebastian Spaeth
On Mon, 21 Mar 2011 11:01:24 -0700, Jameson Rollins 
jroll...@finestructure.net wrote:
 Oh good call, Jesse.  Bonus points for you!  That was the problem.  Damn
 it.  In retrospect that's so obvious, though, isn't it!  I had purged
 the notmuch binary package, but had accidentally left libnotmuch1 and
 libnotmuch-dev installed.  Removing those packages and pointing to my
 locally installed libraries fixed the problem.

Pfeww, I was getting very scared that the python bindings have serious
flaws that I am not aware of. Don't ever do that again to me :-).

Glad you could sort it out. Unfortunately it is not easy to tease out
the path of the libnotmuch being used, otherwise we could debug-output
it.

Sebastian


pgpK3hDfnppRv.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with folder: search in python bindings

2011-03-22 Thread Jameson Rollins
On Tue, 22 Mar 2011 10:35:17 +0100, Sebastian Spaeth sebast...@sspaeth.de 
wrote:
 Pfeww, I was getting very scared that the python bindings have serious
 flaws that I am not aware of. Don't ever do that again to me :-).

In the future, we should make sure that all new features are included
since the beginning.  That way we'll avoid all future library
incompatibilities.

jamie.


pgpN2kHBsiRBy.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


problem with folder: search in python bindings

2011-03-21 Thread Sebastian Spaeth
On Thu, 17 Mar 2011 09:19:29 -0700, Jameson Rollins  wrote:
> Hey, Sebastian.  Can you share your notmuch.py script?

No, it's my secret plan for earning my pension :).
You already got it:
http://git.notmuchmail.org/git/notmuch/blob/HEAD:/bindings/python/notmuch.py

Let me know what you find out.

Sebastian
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 



problem with folder: search in python bindings

2011-03-21 Thread Jesse Rosenthal
On Mon, 21 Mar 2011 10:34:29 -0700, Jameson Rollins  wrote:
> It's going to take a lot more digging before I can identify what is
> common about these messages and different from all the messages that are
> not returned.  

One guess: do those messages happen to have "folder:sent" in the
body? If so, that might point to the possibility that the python
bindings are using a different libnotmuch. Perhaps they have a different
search path (and maybe there's a debian installed library around that
they're finding?).


problem with folder: search in python bindings

2011-03-21 Thread Jesse Rosenthal

Hmm, I'm getting the same results from the python implementation.

On Mon, 21 Mar 2011 09:32:52 -0700, Jameson Rollins  wrote:
> Any suggestions about how we might go about debugging this?

One thing to try would be to run it step by step in an interactive session. 
I.e.,

>>> import notmuch as nm
>>> db = nm.Database("/where/ever/it/is")
>>> qry = nm.Query(db, "folder:sent")

Then, two things to look at. What's the output of

>>> qry.count_messages()

and what's the output of 

>>> len(qry.search_messages())

If you're still getting weird results on both, try dumping the search
results into a list

>>> msgs = [m for m in qry.search_messages()]

and take a look at them. Anything special about those messages?

Best,
Jesse



problem with folder: search in python bindings

2011-03-21 Thread Jameson Rollins
On Mon, 21 Mar 2011 13:42:09 -0400, Jesse Rosenthal  
wrote:
> On Mon, 21 Mar 2011 10:34:29 -0700, Jameson Rollins  finestructure.net> wrote:
> > It's going to take a lot more digging before I can identify what is
> > common about these messages and different from all the messages that are
> > not returned.  
> 
> One guess: do those messages happen to have "folder:sent" in the
> body? If so, that might point to the possibility that the python
> bindings are using a different libnotmuch. Perhaps they have a different
> search path (and maybe there's a debian installed library around that
> they're finding?).

Oh good call, Jesse.  Bonus points for you!  That was the problem.  Damn
it.  In retrospect that's so obvious, though, isn't it!  I had purged
the notmuch binary package, but had accidentally left libnotmuch1 and
libnotmuch-dev installed.  Removing those packages and pointing to my
locally installed libraries fixed the problem.

Sorry for spamming the list with what, in retrospect, I should have been
able to figure out on my own.  Thanks again, Jesse.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



problem with folder: search in python bindings

2011-03-21 Thread Jameson Rollins
On Mon, 21 Mar 2011 12:45:06 -0400, Jesse Rosenthal  
wrote:
> One thing to try would be to run it step by step in an interactive session. 
> I.e.,

Hey, Jesse.  So I'm getting different results interactively!:

>>> import notmuch
>>> db = notmuch.Database("/home/jrollins/.mail")
>>> query = notmuch.Query(db, "folder:sent")
>>> query.count_messages()
9L
>>> len(query.search_messages())
9
>>> 

This same search returns 635 results with the binary, 7 results with the
notmuch.py script, and now 9 in this interactive session.  This is going
to be a pain to debug.

> >>> msgs = [m for m in qry.search_messages()]
> 
> and take a look at them. Anything special about those messages?

So I'm seeing quite a few strange things here.

>>> for m in msgs:
... print m.get_message_id()
... print ' ', m.get_filename()
... 
87tyewtobx.fsf at gogo.home
  
/home/jrollins/.mail/mailboxes/snapper/new/1300725908.Vfd05I469d8M318600.snapper
871v20bfij.fsf at servo.finestructure.net
  
/home/jrollins/.mail/mailboxes/snapper/new/1300725184.Vfd05I469d6M959989.snapper
87y64dk9da.fsf at servo.finestructure.net
  
/home/jrollins/.mail/mailboxes/snapper/new/1300378797.Vfd05I469d8M808571.snapper
87aagv2z92.fsf at SSpaeth.de
  
/home/jrollins/.mail/mailboxes/snapper/new/1300267540.Vfd05I46a17M964837.snapper
87tyf4xmm1.fsf at servo.finestructure.net
  
/home/jrollins/.mail/mailboxes/snapper/new/1300213852.Vfd05I469d8M923454.snapper
1290682750-30283-3-git-send-email-dme at dme.org
  
/home/jrollins/.mail/archive/2010/cur/1290698042_0.5764.servo,U=333629,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
8763426kd5.fsf at steelpick.2x.cz
  
/home/jrollins/.mail/archive/2010/cur/1270740662_1.29713.servo,U=264838,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
87636feg10.fsf at servo.finestructure.net
  /home/jrollins/.mail/archive/2010/cur/1265129567.M505745P5400Q1.servo:2,S
87eil3ehjh.fsf at servo.finestructure.net
  /home/jrollins/.mail/archive/2010/cur/1265127608.M500761P12582Q1.servo:2,S
>>> 

First of all, only messages that were sent by me are in my sent folder.
There are no messages in there that are sent by anyone else.  But this
search is returning messages that are from people other than me.  That
makes no sense.

Second, strangely, all of the messages are ones that are sent to the
notmuch list.  Not sure what to make of that except that the messages
that were sent from me to the list are also in my received mail so are
actually duplicated in my mail store.  I have plenty of other messages
that fall into that same condition, though.

It's going to take a lot more digging before I can identify what is
common about these messages and different from all the messages that are
not returned.  For what it's worth, it's not *just* that they were sent
to the list, since the binary is counting 35 messages that are in the
sent folder and sent to the list:

servo:~ 0$ notmuch count folder:sent and to:notmuch
35
servo:~ 0$ 

I'll keep poking at this, but others can test this and report what they
see I would really appreciate it.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



problem with folder: search in python bindings

2011-03-21 Thread Jameson Rollins
On Mon, 21 Mar 2011 16:29:57 +0100, Sebastian Spaeth  
wrote:
> On Thu, 17 Mar 2011 09:19:29 -0700, Jameson Rollins  finestructure.net> wrote:
> > Hey, Sebastian.  Can you share your notmuch.py script?
> 
> No, it's my secret plan for earning my pension :).
> You already got it:
> http://git.notmuchmail.org/git/notmuch/blob/HEAD:/bindings/python/notmuch.py

Thanks, Sebastian.  Very convenient of you to include it in the repo!

> Let me know what you find out.

So right off the bat I'm seeing a big discrepancy between the results


Re: problem with folder: search in python bindings

2011-03-21 Thread Sebastian Spaeth
On Thu, 17 Mar 2011 09:19:29 -0700, Jameson Rollins 
jroll...@finestructure.net wrote:
 Hey, Sebastian.  Can you share your notmuch.py script?

No, it's my secret plan for earning my pension :).
You already got it:
http://git.notmuchmail.org/git/notmuch/blob/HEAD:/bindings/python/notmuch.py

Let me know what you find out.

Sebastian


pgpE0j3oPXiDc.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with folder: search in python bindings

2011-03-21 Thread Jesse Rosenthal

Hmm, I'm getting the same results from the python implementation.

On Mon, 21 Mar 2011 09:32:52 -0700, Jameson Rollins 
jroll...@finestructure.net wrote:
 Any suggestions about how we might go about debugging this?

One thing to try would be to run it step by step in an interactive session. 
I.e.,

 import notmuch as nm
 db = nm.Database(/where/ever/it/is)
 qry = nm.Query(db, folder:sent)

Then, two things to look at. What's the output of

 qry.count_messages()

and what's the output of 

 len(qry.search_messages())

If you're still getting weird results on both, try dumping the search
results into a list

 msgs = [m for m in qry.search_messages()]

and take a look at them. Anything special about those messages?

Best,
Jesse

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with folder: search in python bindings

2011-03-21 Thread Jameson Rollins
On Mon, 21 Mar 2011 12:45:06 -0400, Jesse Rosenthal jrosent...@jhu.edu wrote:
 One thing to try would be to run it step by step in an interactive session. 
 I.e.,

Hey, Jesse.  So I'm getting different results interactively!:

 import notmuch
 db = notmuch.Database(/home/jrollins/.mail)
 query = notmuch.Query(db, folder:sent)
 query.count_messages()
9L
 len(query.search_messages())
9
 

This same search returns 635 results with the binary, 7 results with the
notmuch.py script, and now 9 in this interactive session.  This is going
to be a pain to debug.

  msgs = [m for m in qry.search_messages()]
 
 and take a look at them. Anything special about those messages?

So I'm seeing quite a few strange things here.

 for m in msgs:
... print m.get_message_id()
... print ' ', m.get_filename()
... 
87tyewtobx@gogo.home
  
/home/jrollins/.mail/mailboxes/snapper/new/1300725908.Vfd05I469d8M318600.snapper
871v20bfij@servo.finestructure.net
  
/home/jrollins/.mail/mailboxes/snapper/new/1300725184.Vfd05I469d6M959989.snapper
87y64dk9da@servo.finestructure.net
  
/home/jrollins/.mail/mailboxes/snapper/new/1300378797.Vfd05I469d8M808571.snapper
87aagv2z92@sspaeth.de
  
/home/jrollins/.mail/mailboxes/snapper/new/1300267540.Vfd05I46a17M964837.snapper
87tyf4xmm1@servo.finestructure.net
  
/home/jrollins/.mail/mailboxes/snapper/new/1300213852.Vfd05I469d8M923454.snapper
1290682750-30283-3-git-send-email-...@dme.org
  
/home/jrollins/.mail/archive/2010/cur/1290698042_0.5764.servo,U=333629,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
8763426kd5@steelpick.2x.cz
  
/home/jrollins/.mail/archive/2010/cur/1270740662_1.29713.servo,U=264838,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
87636feg10@servo.finestructure.net
  /home/jrollins/.mail/archive/2010/cur/1265129567.M505745P5400Q1.servo:2,S
87eil3ehjh@servo.finestructure.net
  /home/jrollins/.mail/archive/2010/cur/1265127608.M500761P12582Q1.servo:2,S
 

First of all, only messages that were sent by me are in my sent folder.
There are no messages in there that are sent by anyone else.  But this
search is returning messages that are from people other than me.  That
makes no sense.

Second, strangely, all of the messages are ones that are sent to the
notmuch list.  Not sure what to make of that except that the messages
that were sent from me to the list are also in my received mail so are
actually duplicated in my mail store.  I have plenty of other messages
that fall into that same condition, though.

It's going to take a lot more digging before I can identify what is
common about these messages and different from all the messages that are
not returned.  For what it's worth, it's not *just* that they were sent
to the list, since the binary is counting 35 messages that are in the
sent folder and sent to the list:

servo:~ 0$ notmuch count folder:sent and to:notmuch
35
servo:~ 0$ 

I'll keep poking at this, but others can test this and report what they
see I would really appreciate it.

jamie.


pgpPG3r8AFELF.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with folder: search in python bindings

2011-03-21 Thread Jesse Rosenthal
On Mon, 21 Mar 2011 10:34:29 -0700, Jameson Rollins 
jroll...@finestructure.net wrote:
 It's going to take a lot more digging before I can identify what is
 common about these messages and different from all the messages that are
 not returned.  

One guess: do those messages happen to have folder:sent in the
body? If so, that might point to the possibility that the python
bindings are using a different libnotmuch. Perhaps they have a different
search path (and maybe there's a debian installed library around that
they're finding?).
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: problem with folder: search in python bindings

2011-03-21 Thread Jameson Rollins
On Mon, 21 Mar 2011 13:42:09 -0400, Jesse Rosenthal jrosent...@jhu.edu wrote:
 On Mon, 21 Mar 2011 10:34:29 -0700, Jameson Rollins 
 jroll...@finestructure.net wrote:
  It's going to take a lot more digging before I can identify what is
  common about these messages and different from all the messages that are
  not returned.  
 
 One guess: do those messages happen to have folder:sent in the
 body? If so, that might point to the possibility that the python
 bindings are using a different libnotmuch. Perhaps they have a different
 search path (and maybe there's a debian installed library around that
 they're finding?).

Oh good call, Jesse.  Bonus points for you!  That was the problem.  Damn
it.  In retrospect that's so obvious, though, isn't it!  I had purged
the notmuch binary package, but had accidentally left libnotmuch1 and
libnotmuch-dev installed.  Removing those packages and pointing to my
locally installed libraries fixed the problem.

Sorry for spamming the list with what, in retrospect, I should have been
able to figure out on my own.  Thanks again, Jesse.

jamie.


pgpQvKzrqeX9E.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


problem with folder: search in python bindings

2011-03-17 Thread Jameson Rollins
On Wed, 16 Mar 2011 10:25:29 +0100, Sebastian Spaeth  
wrote:
> Interesting, this is not at all what I am seeing in the current
> bindings:
> 
> cd ~/src/notmuch/bindings/python;./notmuch.py count 'folder:sent'
> 1957
> /usr/local/bin/notmuch count  'folder:sent'
> 1957

Hey, Sebastian.  Can you share your notmuch.py script?  I want to
compare yours with what I'm doing in my python script.  I don't think
it's a quoting issue, since the quoting I'm using seems to work fine for
other search terms.  It's only with "folder:" searches that I'm seeing
the problem.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



Re: problem with folder: search in python bindings

2011-03-17 Thread Jameson Rollins
On Wed, 16 Mar 2011 10:25:29 +0100, Sebastian Spaeth sebast...@sspaeth.de 
wrote:
 Interesting, this is not at all what I am seeing in the current
 bindings:
 
 cd ~/src/notmuch/bindings/python;./notmuch.py count 'folder:sent'
 1957
 /usr/local/bin/notmuch count  'folder:sent'
 1957

Hey, Sebastian.  Can you share your notmuch.py script?  I want to
compare yours with what I'm doing in my python script.  I don't think
it's a quoting issue, since the quoting I'm using seems to work fine for
other search terms.  It's only with folder: searches that I'm seeing
the problem.

jamie.


pgp0xKqFhyPFq.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


problem with folder: search in python bindings

2011-03-16 Thread Sebastian Spaeth
On Tue, 15 Mar 2011 11:30:30 -0700, Jameson Rollins  wrote:
> Hey, folks.  I'm seeing something peculiar with the python bindings.
> It seems that I am not able to get any results when doing "folder:"
> searches with the python bindings.  I'm using a version of notmuch that
> includes the folder index patch.

Interesting, this is not at all what I am seeing in the current
bindings:

cd ~/src/notmuch/bindings/python;./notmuch.py count 'folder:sent'
1957
/usr/local/bin/notmuch count  'folder:sent'
1957

> Anyone have any idea what could be going on here?  I'm not familiar with
> how the python bindings work, unfortunately.

The folder: stuff came after my latest work on the bindings, so I
haven't really tested things with that. But I don't see why it should
work any other than other queries too.

Some quotation issues at work perhaps?

Sebastian
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: 



Re: problem with folder: search in python bindings

2011-03-16 Thread Sebastian Spaeth
On Tue, 15 Mar 2011 11:30:30 -0700, Jameson Rollins 
jroll...@finestructure.net wrote:
 Hey, folks.  I'm seeing something peculiar with the python bindings.
 It seems that I am not able to get any results when doing folder:
 searches with the python bindings.  I'm using a version of notmuch that
 includes the folder index patch.

Interesting, this is not at all what I am seeing in the current
bindings:

cd ~/src/notmuch/bindings/python;./notmuch.py count 'folder:sent'
1957
/usr/local/bin/notmuch count  'folder:sent'
1957

 Anyone have any idea what could be going on here?  I'm not familiar with
 how the python bindings work, unfortunately.

The folder: stuff came after my latest work on the bindings, so I
haven't really tested things with that. But I don't see why it should
work any other than other queries too.

Some quotation issues at work perhaps?

Sebastian


pgpPqK4Z83IUi.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


problem with folder: search in python bindings

2011-03-15 Thread Jameson Rollins
Hey, folks.  I'm seeing something peculiar with the python bindings.
It seems that I am not able to get any results when doing "folder:"
searches with the python bindings.  I'm using a version of notmuch that
includes the folder index patch.

Attached is a script that demonstrates the problem.  It generates a test
repository, then does a couple of searches over it.  When running the
script, I get the following output:

0$ ./python-folder-search-test
Found 2 total files (that's not much mail).
Note: Ignoring non-mail file: /home/jrollins/tmp/tmp.1dMO5vnweJ/config
Processed 2 total files in almost no time.
Added 1 new message to the database.
== notmuch search '*':
thread:0001  Yest. 23:26 [1/1] Jameson Rollins; python 
documentation (inbox signed unread)
== notmuch search 'folder:sent':
thread:0001  Yest. 23:26 [1/1] Jameson Rollins; python 
documentation (inbox signed unread)
== python search '*':
Jameson Rollins  (2011-03-14) (inbox signed 
unread) (-1) replies
== python search 'folder:sent':
0$ 

You can see that cli notmuch returns search results when searching for
"folder:sent".  The python bindings, on the other hand, return nothing.

Anyone have any idea what could be going on here?  I'm not familiar with
how the python bindings work, unfortunately.

jamie.

-- next part --
A non-text attachment was scrubbed...
Name: python-folder-search
Type: application/octet-stream
Size: 741 bytes
Desc: script to test python folder: search
URL: 

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



problem with folder: search in python bindings

2011-03-15 Thread Jameson Rollins
Hey, folks.  I'm seeing something peculiar with the python bindings.
It seems that I am not able to get any results when doing folder:
searches with the python bindings.  I'm using a version of notmuch that
includes the folder index patch.

Attached is a script that demonstrates the problem.  It generates a test
repository, then does a couple of searches over it.  When running the
script, I get the following output:

0$ ./python-folder-search-test
Found 2 total files (that's not much mail).
Note: Ignoring non-mail file: /home/jrollins/tmp/tmp.1dMO5vnweJ/config
Processed 2 total files in almost no time.
Added 1 new message to the database.
== notmuch search '*':
thread:0001  Yest. 23:26 [1/1] Jameson Rollins; python 
documentation (inbox signed unread)
== notmuch search 'folder:sent':
thread:0001  Yest. 23:26 [1/1] Jameson Rollins; python 
documentation (inbox signed unread)
== python search '*':
Jameson Rollins jroll...@finestructure.net (2011-03-14) (inbox signed unread) 
(-1) replies
== python search 'folder:sent':
0$ 

You can see that cli notmuch returns search results when searching for
folder:sent.  The python bindings, on the other hand, return nothing.

Anyone have any idea what could be going on here?  I'm not familiar with
how the python bindings work, unfortunately.

jamie.



python-folder-search
Description: script to test python folder: search


pgpfQvk27pnlH.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch