[PATCH 4/6] Fix the COERCE_STATUS macro

2012-09-24 Thread Justus Winter
Fix the COERCE_STATUS macro to handle _internal_error being declared as void function. Note that the function _internal_error does not return. Evaluating to NOTMUCH_STATUS_SUCCESS is done purely to appease the compiler. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --

[PATCH 6/6] Avoid potentially dereferencing a NULL pointer

2012-09-24 Thread Justus Winter
GMIME_IS_MULTIPART and GMIME_IS_MESSAGE both handle NULL pointers gracefully, but the G_OBJECT_TYPE used in the error handling block dereferences it without checking it first. Fix this by checking whether parent->part is valid. Found using the clang static analyzer. Signed-off-by: Justus Win

[PATCH 2/6] Provide a NORETURN_ATTRIBUTE macro similar to PRINTF_ATTRIBUTE

2012-09-24 Thread Justus Winter
This attribute is understood by gcc since version 2.5. clang provides support for testing for function attributes using __has_attribute. For other compilers this macro evaluates to the empty string. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- compat/function-attrib

Re: nbook: a notmuch based address book written in python

2012-10-15 Thread Justus Winter
Hi Suvayu :) welcome to notmuch and python. Quoting Patrick Totzke (2012-10-13 18:58:51) > > > 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 init

Re: [PATCH 1/3] Go bindings: clean up the documentation

2013-03-02 Thread Justus Winter
Hi Julius, Quoting Julius Plenz (2013-03-02 15:50:54) > Most of the copy&paste is either misleading or not helpful; remove that, and > add useful comments where it’s helping. > --- > [...] > +// Open an existing notmuch database located at 'path'. By default the > +// database should be opened for

Re: [PATCH 2/3] Go bindings: wrap notmuch_message_get_date

2013-03-02 Thread Justus Winter
Quoting Julius Plenz (2013-03-02 15:50:55) > -// TODO: wrap notmuch_message_get_date > +func (self *Message) GetDate() time.Time { It's customary to name the receiver just m for the type Message. I realize that the rest of the code uses self too, but I'd love to see this converted and maybe we sho

Re: [RFC/PATCH] python: search parent lib directory for libnotmuch.so

2013-04-09 Thread Justus Winter
Hi Jed, Quoting Jed Brown (2013-04-09 04:47:26) > If libnotmuch.so is installed to a path that is not searched by > dlopen(3), we must import it using an absolute path because the Python > bindings do not have the luxury of RPATH linking. So strip off the > trailing directories from the install l

Re: [RFC/PATCH] python: search parent lib directory for libnotmuch.so

2013-04-09 Thread Justus Winter
Quoting Jed Brown (2013-04-09 16:57:05) > Justus Winter <4win...@informatik.uni-hamburg.de> writes: > > > > May I ask why you cannot use LD_LIBRARY_PATH? I too install libnotmuch > > to a non-standard location as unprivileged user and to make this > > li

Re: Python analogous for the CLI command

2013-04-18 Thread Justus Winter
Hi Flavius :) welcome to notmuch :) Quoting Flavius Aspra (2013-04-18 10:11:37) > Can you give me some pointers on how to use the python module to get the JSON > data with notmuch effort, equivalent to the command: ^^^ hehe :) Ok, here it is: teythoon@thinkbox ~/tmp % cat flaviu

[PATCH] go: use a different goconfig package

2013-04-23 Thread Justus Winter
ns differ at the API level, the code is updated accordingly. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/go/Makefile |4 ++-- bindings/go/src/notmuch-addrlookup/addrlookup.go | 14 ++ 2 files changed, 8 insertions

Re: [PATCH] go: use a different goconfig package

2013-04-24 Thread Justus Winter
Quoting David Bremner (2013-04-24 00:51:11) > Justus Winter <4win...@informatik.uni-hamburg.de> writes: > > > The notmuch-addrlookup utility uses a third party library to read the > > notmuch configuration file. The previously used implementation at > > "gith

Re: Python Bindings missing on PyPI

2013-05-21 Thread Justus Winter
Hi :) Quoting David Bremner (2013-05-20 16:32:32) > Patrick Gerken writes: > > Is there any rationale that prevents registering the python bindings > > on pypi? I believe the python bindings were once available on pypi, though that might have been a relict from the time the python bindings were

Re: [RFC PATCH 1/1] add --stderr option

2013-05-21 Thread Justus Winter
Quoting Tomi Ollila (2013-05-21 20:42:30) > --- > > Note quickly written untested code (but compiles!), just to show an idea... > > This implements (i hope) curl(1) --stderr option in notmuch(1): > >--stderr > Redirect all writes to stderr to the specified file instead. I

Re: [RFC PATCH 1/1] add --stderr option

2013-05-22 Thread Justus Winter
Quoting Tomi Ollila (2013-05-22 09:50:46) > On Tue, May 21 2013, Justus Winter <4win...@informatik.uni-hamburg.de> wrote: > > > Quoting Tomi Ollila (2013-05-21 20:42:30) > >> --- > >> > >> Note quickly written untested code (but compiles!), just to

Re: Python Bindings missing on PyPI

2013-05-23 Thread Justus Winter
Quoting Patrick Gerken (2013-05-22 12:08:30) > Quoting Justus Winter (2013-05-21 14:54:02) > > Hi :) > > > > Quoting David Bremner (2013-05-20 16:32:32) > > > Patrick Gerken writes: > > I would not object to that, but David has a point here. If the version

Re: The Python bindings are now back on PyPI

2013-05-27 Thread Justus Winter
Hi :) Quoting Julian Berman (2013-05-26 16:27:31) > I've queried gently to find out if anyone was interested in putting the Python > bindings back on PyPI a few times in IRC before, and didn't really see much > interest one way or the other. I saw a mailing list post that seemed > indifferent, tho

Re: [PATCH] Fix shared library loading in Python bindings.

2013-05-30 Thread Justus Winter
Hi Julian :) Quoting Julian Berman (2013-05-26 05:53:38) > Specifically, fixes loading on OS X, where libnotmuch will be > a dylib.: > --- > bindings/python/notmuch/globals.py | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/bindings/python/notmuch/globals.py > b/bindi

Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types

2014-01-24 Thread Justus Winter
Hi :) Quoting David Bremner (2014-01-24 14:17:27) > Justus Winter <4win...@informatik.uni-hamburg.de> writes: > > > Quoting Justus Winter (2011-12-07 19:49:31) > > > And another one: > [stack trace snipped] > > #69 0x004e10be in PyRun_SimpleFil

Re: [PATCH] python: Add binding for notmuch_query_add_tag_exclude

2014-09-23 Thread Justus Winter
Quoting David Bremner (2014-09-20 07:15:02) > Thibaut Horel writes: > > > Implemented as the method `exclude_tag` of the class `Query`. This method > > takes > > one argument, a string containing the name of the tag to exclude > > This tag looks pretty trivial. I'll merge it unless I hear some

Re: Looking for the perfect mail client

2014-10-23 Thread Justus Winter
Quoting Sepp Tannhuber (2014-10-23 12:47:10) > Peter Feigl schrieb am 19:38 Mittwoch, 22.Oktober 2014: > > Try strace or > > gdb to find out what really crashes notmuch. > Good idea. Can anybody help me to interprete the output: > https://gist.github.com/tannhuber/c7cae862f897efccd3cb Your proces

Re: notmuch.readthedocs.org

2014-11-17 Thread Justus Winter
Quoting David Bremner (2014-11-16 21:23:21) > Ben Gamari writes: > > > > > David, perhaps you could update the description of the notmuch RtD > > project to reflect that fact that it is no longer describing the Python > > bindings? Indeed, the 0.14 version still documents the python bindings, wh

Re: notmuch.readthedocs.org

2014-11-18 Thread Justus Winter
Hey Sebastian, Quoting Sebastian Spaeth (2014-11-18 09:44:15) > Let me know if I should be deleting the site. Or hand it over, or > something :-). If I remember correctly, you handed notmuch.rtfd.org over to me. Or you deleted the project, and I created a new one in its place, I don't recall. B

Re: [PATCH v2] add notmuch.Database.get_status_string()

2015-12-11 Thread Justus Winter
Quoting Daniel Kahn Gillmor (2015-12-10 03:18:17) > Sorry about the first version, which didn't handle a NULL value > properly. Please only consider this v2 version. Applied, thanks. I changed it slightly to conform with our naming scheme. Justus signature.asc Description: signature _

Compilation failure with gcc 4.4.7

2015-12-19 Thread Justus Winter
Hello, I just tried to compile notmuch with an oldish compiler, and that failed (if the compiler is indeed too old, then at least the error message should be more helpful): % ./configure --prefix=$HOME/stow/notmuch [...] Sanity checking C compilation environment... OK. Sanity checking C++ compila

Re: [PATCH] notmuch.Database.remove_message should raise exception on failure

2016-02-11 Thread Justus Winter
Quoting Daniel Kahn Gillmor (2016-02-10 17:53:46) > The notmuch python bindings document that database.remove_message > should raise an exception when the message removal fails, but they > don't actually do it. Merged, thanks! Justus ___ notmuch mailing

Re: [PATCH] lib: have two definitions of NOTMUCH_DEPRECATED macro

2016-03-01 Thread Justus Winter
Quoting Jani Nikula (2015-12-29 12:52:20) > > __has_extension() replacement was modeled after __has_attribute() > > definition in compat/function-attributes.h. Thanks Justus. Hum, I didn't even recall doing that. > > +/* clang provides this macro to test for support for language > > + * extension

Re: Bug#817964: notmuch: indexing daemon

2016-03-13 Thread Justus Winter
Quoting David Bremner (2016-03-12 12:24:47) > Paul Wise writes: > > I expect the right interface to use for notifications of filesystem > > events is inotify since fanotify doesn't send rename events. This would > > require one inotify per directory. Fwiw, afew does exactly that. Justus

Re: [Jakub Wilk] Bug#749890: python3-notmuch: missing header in mbox message -> NullPointerError

2016-03-14 Thread Justus Winter
Hi, Quoting David Bremner (2014-05-30 15:14:46) > this looks like a bug in the python bindings to me > > Package: python3-notmuch > Version: 0.18-3 > Severity: minor > > If a message starts with the "From " postmark (i.e., it's in the mbox > format), and you ask the get_header() method for a no

[PATCH] properly raise exceptions in python bindings

2011-09-26 Thread Justus Winter
There are various locations where exceptions are constructed but not raised. This patch adds the necessary raise statements. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py |4 ++-- bindings/python/notmuch/filename.py

[PATCH 1/9] python: add a .gitignore file and refine the toplevel one

2011-09-26 Thread Justus Winter
the python directory. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- .gitignore |2 +- bindings/python/.gitignore |2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) create mode 100644 bindings/python/.gitignore diff --git a/.gitignore b/.gitigno

[PATCH 2/9] python: add status and message attributes to NotmuchError

2011-09-26 Thread Justus Winter
Providing exception objects with meaningful attribute names is much nicer than using e.args[]. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/globals.py |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bindings/

[PATCH 4/9] python: fix NotmuchError.__str__ if status == None

2011-09-26 Thread Justus Winter
Passing None to STATUS.status2str raises an ArgumentError. Add a check for this case and provide a generic message. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/globals.py |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff -

[PATCH 5/9] python: rename _verify_initialized_db to _assert_db_is_initialized

2011-09-26 Thread Justus Winter
Rename the function to clarify its effect and remove all the comments accompanying each call to the function. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 32 +++- 1 files changed, 11 insertions(

[PATCH 7/9] python: provide more exception classes

2011-09-26 Thread Justus Winter
classes in __init__.py so they can be easily imported by anyone. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/__init__.py | 16 ++- bindings/python/notmuch/globals.py | 37 +++ 2 files chang

[PATCH 6/9] python: rename _verify_dir_initialized to _assert_dir_is_initialized

2011-09-26 Thread Justus Winter
Rename the function to clarify its effect and remove all the comments accompanying each call to the function. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 14 +- 1 files changed, 5 insertions(+), 9 deletions(-)

[PATCH 9/9] python: raise a more specific error in Messages.print_messages

2011-09-26 Thread Justus Winter
Raising Exception is considered bad since the only way to catch it is to do 'except Exception'. Raising a TypeError is more appropriate. Since the format parameter has already been validated, checking it again is not necessary. Simplify this conditional. Signed-off-by: Justus Wi

[PATCH 3/9] python: reorder the arguments of NotmuchError.__init__()

2011-09-26 Thread Justus Winter
It is customary for subclasses of Exception to take a string as the first argument that describes the problem. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 48 ++-- bindings/python/notmuch/filename.py

[PATCH 8/9] python: use the new exception classes and update the documentation

2011-09-26 Thread Justus Winter
Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 138 +-- bindings/python/notmuch/filename.py |9 +- bindings/python/notmuch/message.py | 79 ++-- bindings/python/notmuch/

Re: [PATCH 1/9] python: add a .gitignore file and refine the toplevel one

2011-09-29 Thread Justus Winter
Hi Sebastian, Quoting Sebastian Spaeth (2011-09-29 09:45:38) >Also, not all "status" are an error, e.g. DuplicateMessageId denotes >success rather than failure, it just communicates a status. I just stumbled upon the following comment in notmuch.h: /* Status codes used for the return values of

[PATCH] python: fix docstring of Message.get_header()

2011-09-29 Thread Justus Winter
Update the docstring from notmuch.h. Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/message.py | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bindings/python/notmuch/message.py b/bindings/python/n

python(?): process died while iterating over Messages object

2011-09-30 Thread Justus Winter
Hi, while iterating over a query result set my process died with > terminate called after throwing an instance of 'Xapian::DatabaseModifiedError' > Aborted I am not sure where this came from, grepping throuth notmuchs soure didn't reveal the location. So this might be not specific to the pytho

Re: [PATCH 7/9] python: provide more exception classes

2011-09-30 Thread Justus Winter
Quoting Sebastian Spaeth (2011-09-30 14:00:36) >On Mon, 26 Sep 2011 03:05:35 +0200, Justus Winter ><4win...@informatik.uni-hamburg.de> wrote: >> To make the exception handling more effective in code using the >> python bindings it is necessary to differentiate between

Re: python(?): process died while iterating over Messages object

2011-09-30 Thread Justus Winter
Quoting Tom Prince (2011-09-30 15:12:50) >On Fri, 30 Sep 2011 12:43:53 +0200, Justus Winter ><4win...@informatik.uni-hamburg.de> wrote: >> while iterating over a query result set my process died with >> >> > terminate called after throwing an instance of &g

python: unpythonic result of Message.get_replies()

2011-10-04 Thread Justus Winter
Hi everyone :) I noticed that Message.get_replies() returns a Messages object *or* None. Quoting the documentation: > Returns: Messages or None if there are no replies to this message Messages is a class implementing the iterator protocol, so a python programmer would expect to get an iterator

[PATCH 1/2] python: add classes to wrap all notmuch_*_t types

2011-10-10 Thread Justus Winter
Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- bindings/python/notmuch/globals.py | 38 +++- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py

[PATCH 2/2] python: annotate all calls into libnotmuch with types

2011-10-10 Thread Justus Winter
Add type information to the ctypes._FuncPtr wrappers and use the wrapper classes instead of c_void_p for pointers to notmuch_*_t. This enables the ctypes library to type check parameters being handed to functions from the notmuch library. Signed-off-by: Justus Winter <4win...@informatik.

Re: [PATCH 1/2] python: add classes to wrap all notmuch_*_t types

2011-11-28 Thread Justus Winter
Quoting Sebastian Spaeth (2011-11-02 08:25:53) >On Mon, 10 Oct 2011 00:12:53 +0200, Justus Winter ><4win...@informatik.uni-hamburg.de> wrote: >> Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> >> --- >> bindi

Re: [PATCH 1/2] python: add classes to wrap all notmuch_*_t types

2011-12-02 Thread Justus Winter
Quoting James Westby (2011-12-02 00:32:30) >On Thu, 01 Dec 2011 22:25:41 +0100, Sebastian Spaeth >wrote: >> This strikes me as a rather good thing, so the patches went in. > >Hah, I've just seen this, and I'm going to guess that it fixes my >problems too. > >... > >I've tested and it seems to wor

Re: [PATCH 1/2] python: add classes to wrap all notmuch_*_t types

2011-12-02 Thread Justus Winter
Quoting James Westby (2011-12-03 00:24:18) >On Fri, 02 Dec 2011 09:20:35 -0500, James Westby >wrote: >> I'll test again to make sure that I have this correct, but my tests >> yesterday certainly suggested that your patches fixed this. > >Yep, segfaults a plenty dropping your second patch that go

RFC: don't ask users to do 'sudo make install'

2011-12-07 Thread Justus Winter
Hey everyone, I just noticed that running configure says: > All required packages were found. You may now run the following > commands to compile and install notmuch: > >make >sudo make install I think that this is a very poor advice in general and we shouldn't give it to users.

Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types

2011-12-07 Thread Justus Winter
Quoting Justus Winter (2011-12-06 13:51:08) >Quoting Sebastian Spaeth (2011-12-06 13:05:53) >>On Tue, 06 Dec 2011 10:46:31 +, Patrick Totzke >> wrote: >>> This commit breaks raising XapianErrors for me. >>> >>> If I lock the index with some `notmuch

Re: [PATCH 2/2] python: annotate all calls into libnotmuch with types

2011-12-07 Thread Justus Winter
Quoting Justus Winter (2011-12-07 19:49:31) >Quoting Justus Winter (2011-12-06 13:51:08) >>I began running alot in gdb since I get segfaults within libnotmuch >>from time to time and managed to get a stack trace pointing to >>notmuch_database_begin_atomic, but I couldn

[afew] announcing afew, an universal tagging solution with some fancy features

2011-12-14 Thread Justus Winter
Hey everyone :) I'd like to introduce my initial tagging approach, afew tags: https://github.com/teythoon/afew It has some nifty features, citing the README: * text classification, magic tags aka the mailing list without server * spam handling (flush all tags, add spam) * killed thread handling

[python] RFC: supporting python 2 and 3 with one codebase

2011-12-14 Thread Justus Winter
Hi everyone :) attached is a patch series that makes the notmuch python bindings compatible with both python 2.x and python 3.x. There are some workarounds, but those are mostly in globals.py and in my opinion the benefit of supporting both versions with one codebase is totally worth it. Patch s

[PATCH 1/7] py3k: The execfile built-in has been removed in python 3

2011-12-14 Thread Justus Winter
--- bindings/python/setup.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 286fd19..2e58dab 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -7,7 +7,7 @@ from distutils.core import setup #

[PATCH 2/7] py3k: The ConfigParser module has been renamed to configparser

2011-12-14 Thread Justus Winter
--- bindings/python/notmuch.py |7 ++- bindings/python/notmuch/database.py |8 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bindings/python/notmuch.py b/bindings/python/notmuch.py index 8d11859..3ff53ec 100755 --- a/bindings/python/notmuch.py +++ b/

[PATCH 3/7] py3k: All strings are unicode strings in py3k

2011-12-14 Thread Justus Winter
--- bindings/python/notmuch/globals.py |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py index 54a49b2..99e6a10 100644 --- a/bindings/python/notmuch/globals.py +++ b/bindings/python/notmuch/globals.p

[PATCH 5/7] py3k: the basestring and unicode types are removed in python 3

2011-12-14 Thread Justus Winter
--- bindings/python/notmuch/globals.py |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py index 99e6a10..c52790c 100644 --- a/bindings/python/notmuch/globals.py +++ b/bindings/python/notmuch/globals.

[PATCH 4/7] py3k: Rename .next() to __next__(), add python2.x compatibility alias

2011-12-14 Thread Justus Winter
--- bindings/python/notmuch/database.py |3 ++- bindings/python/notmuch/message.py |3 ++- bindings/python/notmuch/tag.py |3 ++- bindings/python/notmuch/thread.py |3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bindings/python/notmuch/database.py b/

[PATCH 6/7] py3k: Add and use a mixin class that implements __str__

2011-12-14 Thread Justus Winter
--- bindings/python/notmuch/filename.py |7 ++- bindings/python/notmuch/globals.py | 15 +++ bindings/python/notmuch/message.py |8 +++- bindings/python/notmuch/tag.py |7 ++- bindings/python/notmuch/thread.py |6 +++--- 5 files changed, 21 insert

[PATCH 7/7] python: add missing conversions from and to utf-8

2011-12-14 Thread Justus Winter
--- bindings/python/notmuch/database.py |6 +++--- bindings/python/notmuch/filename.py |2 +- bindings/python/notmuch/message.py |8 bindings/python/notmuch/thread.py |2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bindings/python/notmuch/database.

Re: [afew] announcing afew,

2011-12-14 Thread Justus Winter
Quoting Kazuo Teramoto (2011-12-14 12:24:14) >an universal tagging solution with some fancy features >From: Kazuo Teramoto >In-Reply-To: >On 2011-12-14T08:42:36, Justus Winter wrote: >>I'd like to introduce my initial tagging approach, afew tags: >> >>https://

Re: [PATCH 3/7] py3k: All strings are unicode strings in py3k

2011-12-14 Thread Justus Winter
Hi Tomi :) Quoting Tomi Ollila (2011-12-14 13:17:41) >On Wed, 14 Dec 2011 11:58:21 +0100, Justus Winter ><4win...@informatik.uni-hamburg.de> wrote: >> --- >> bindings/python/notmuch/globals.py |4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >&

Re: [PATCH 6/7] py3k: Add and use a mixin class that implements __str__

2011-12-14 Thread Justus Winter
Quoting Tomi Ollila (2011-12-14 13:26:38) >On Wed, 14 Dec 2011 11:58:24 +0100, Justus Winter ><4win...@informatik.uni-hamburg.de> wrote: >> --- >[ ... snip ... ] > >> >> -class Filenames(object): >> +class Filenames(Python3StringMixIn): >>

[PATCH 6/7] py3k: Add and use a mixin class that implements __str__

2011-12-14 Thread Justus Winter
--- bindings/python/notmuch/filename.py |7 ++- bindings/python/notmuch/globals.py | 15 +++ bindings/python/notmuch/message.py |8 +++- bindings/python/notmuch/tag.py |7 ++- bindings/python/notmuch/thread.py |7 ++- 5 files changed, 20 inser

Re: [afew] announcing afew, an universal tagging solution with some fancy features

2011-12-19 Thread Justus Winter
Hey Pazz :) Quoting Patrick Totzke (2011-12-14 17:59:43) >Hi Justus, > >I have just tried your script and have some questions/remarks about it: > >* mkdir -p ~/.config/afew ~/.local/share/afew/categories > As far as I can see, this is not needed if one doesn't use ClassifyingFilter, > so its OK

Re: [afew] announcing afew, an universal tagging solution with some fancy features

2011-12-21 Thread Justus Winter
Hey Jamie :) Quoting Jameson Graef Rollins (2011-12-19 18:57:00) >On Mon, 19 Dec 2011 15:13:51 +0100, Justus Winter ><4win...@informatik.uni-hamburg.de> wrote: >> Is your new tag called 'is:new'? Mine is just called 'new' > >is: is a search pref

Re: [afew] announcing afew, an universal tagging solution with some fancy features

2011-12-21 Thread Justus Winter
Hey Pazz, Quoting Patrick Totzke (2011-12-19 19:17:12) >Also, should i not get some output when calling afew with -vv ? Yes you should ;). Here's an example run on my box: teythoon@thinkbox ~/repos/afew (git)-[master] % python3.2 bin/afew -vv --tag --new INFO:root:Tagging spam messages DEBUG:ro

patchwork link 404s

2011-12-21 Thread Justus Winter
Hi everyone :) the patchwork instance referenced on notmuchmail.org [0] returns a 404 not found. Cheers, Justus 0: http://patchwork.notmuchmail.org/project/notmuch .signature Description: Binary data ___ notmuch mailing list notmuch@notmuchmail.org h

RFC: use the XDG Base Directory Specification for configuration data

2011-12-21 Thread Justus Winter
Hi :) I'd like to propose to store notmuchs configuration in $XDG_CONFIG_HOME/notmuch/config as suggested in the XDG Base Directory Specification [0]. Similarly $XDG_DATA_HOME/nmbug might be a more appropriate location for nmbugs git checkout than ~/.nmbug. Cheers, Justus 0: http://standards.fr

Re: python: unpythonic result of Message.get_replies()

2011-12-21 Thread Justus Winter
The attached patch series fixes this problem. Note that the wrapping nature of the notmuch bindings makes it kind of awkward to fix the behavior. I've decided to avoid introducing code to the Messages class to indicate that there are no messages and there is no notmuch object being wrapped, but to

[PATCH 2/2] python: make the result of Message.get_replies() more pythonic

2011-12-21 Thread Justus Winter
Formerly Message.get_replies() returned an iterator or None forcing users to check the result before iterating over it leading to strange looking code at the call site. Fix this flaw by adding an EmptyMessagesResult class that behaves like the Messages class but immediatly raises StopIteration if

[PATCH 1/2] python: refactor print_messages into format_messages and print_messages

2011-12-21 Thread Justus Winter
--- bindings/python/notmuch/message.py | 37 +-- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py index ce8e718..cc9fc2a 100644 --- a/bindings/python/notmuch/message.py +++ b/

Re: [PATCH 5/7] py3k: the basestring and unicode types are removed in python 3

2012-01-08 Thread Justus Winter
Hi Tomi, Hi Sebastian :) Quoting Tomi Ollila (2012-01-04 19:07:11) >On Mon, 02 Jan 2012 16:15:58 +0100, Sebastian Spaeth >wrote: >> Happy new year. Pushed patches 1-4 of this series so far. Looking fine, nice, thanks. >> but ugh, the below seems like a rather ugly hack in a function that is >>

[PATCH] py3k: the basestring and unicode types are removed in python 3

2012-01-08 Thread Justus Winter
--- bindings/python/notmuch/globals.py | 34 ++ 1 files changed, 22 insertions(+), 12 deletions(-) diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py index 32ed9ae..4138460 100644 --- a/bindings/python/notmuch/globals.py +++ b/b

Re: Python bindings for adoption

2012-01-08 Thread Justus Winter
enormous amounts of time on notmuch. I am >already neglecting offlineimap, which also needs some attention. > >As I have repeatedly stated that I want to hand over the maintainership >of the notmuch python bindings, and I would like to do it asap. I feel >that people like Patrick Tot

Re: nmbug changes

2012-01-08 Thread Justus Winter
Hey David, Quoting David Bremner (2011-12-23 22:56:31) >For those of you following/using the nmbug experiment, I made some >slightly disruptive changes, in order to support auto-updating the web >view on push. I'm having trouble with nmbug, I did follow the instructions in this mail and in the wi

Re: nmbug changes

2012-01-09 Thread Justus Winter
Quoting David Bremner (2012-01-08 23:34:26) >On Sun, 08 Jan 2012 16:24:06 -0000, Justus Winter ><4win...@informatik.uni-hamburg.de> wrote: > >> I'm having trouble with nmbug, I did follow the instructions in this >> mail and in the wiki, but nmbug never adds tags

[PATCH] properly raise exceptions in python bindings

2011-09-25 Thread Justus Winter
There are various locations where exceptions are constructed but not raised. This patch adds the necessary raise statements. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py |4 ++-- bindings/python/notmuch/filename.py

[PATCH 1/9] python: add a .gitignore file and refine the toplevel one

2011-09-26 Thread Justus Winter
the python directory. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- .gitignore |2 +- bindings/python/.gitignore |2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) create mode 100644 bindings/python/.gitignore diff --git a/.gitignore b/.gitigno

[PATCH 2/9] python: add status and message attributes to NotmuchError

2011-09-26 Thread Justus Winter
Providing exception objects with meaningful attribute names is much nicer than using e.args[]. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/globals.py |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bi

[PATCH 4/9] python: fix NotmuchError.__str__ if status == None

2011-09-26 Thread Justus Winter
Passing None to STATUS.status2str raises an ArgumentError. Add a check for this case and provide a generic message. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/globals.py |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff

[PATCH 5/9] python: rename _verify_initialized_db to _assert_db_is_initialized

2011-09-26 Thread Justus Winter
Rename the function to clarify its effect and remove all the comments accompanying each call to the function. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 32 +++- 1 files changed, 11 insertions(

[PATCH 7/9] python: provide more exception classes

2011-09-26 Thread Justus Winter
classes in __init__.py so they can be easily imported by anyone. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/__init__.py | 16 ++- bindings/python/notmuch/globals.py | 37 +++ 2 files chang

[PATCH 6/9] python: rename _verify_dir_initialized to _assert_dir_is_initialized

2011-09-26 Thread Justus Winter
Rename the function to clarify its effect and remove all the comments accompanying each call to the function. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 14 +- 1 files changed, 5 insertions(+), 9 deletions(-)

[PATCH 9/9] python: raise a more specific error in Messages.print_messages

2011-09-26 Thread Justus Winter
Raising Exception is considered bad since the only way to catch it is to do 'except Exception'. Raising a TypeError is more appropriate. Since the format parameter has already been validated, checking it again is not necessary. Simplify this conditional. Signed-off-by: Justus Winter &

[PATCH 3/9] python: reorder the arguments of NotmuchError.__init__()

2011-09-26 Thread Justus Winter
It is customary for subclasses of Exception to take a string as the first argument that describes the problem. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 48 ++-- bindings/python/notmuch/filen

[PATCH 8/9] python: use the new exception classes and update the documentation

2011-09-26 Thread Justus Winter
Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/database.py | 138 +-- bindings/python/notmuch/filename.py |9 +- bindings/python/notmuch/message.py | 79 ++-- bindings/python/notmuch/

[PATCH 1/9] python: add a .gitignore file and refine the toplevel one

2011-09-30 Thread Justus Winter
Hi Sebastian, Quoting Sebastian Spaeth (2011-09-29 09:45:38) >Also, not all "status" are an error, e.g. DuplicateMessageId denotes >success rather than failure, it just communicates a status. I just stumbled upon the following comment in notmuch.h: /* Status codes used for the return values of

[PATCH] python: fix docstring of Message.get_header()

2011-09-30 Thread Justus Winter
Update the docstring from notmuch.h. Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/message.py | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bindings/python/notmuch/message.py b/bindings/python/n

python(?): process died while iterating over Messages object

2011-09-30 Thread Justus Winter
Hi, while iterating over a query result set my process died with > terminate called after throwing an instance of 'Xapian::DatabaseModifiedError' > Aborted I am not sure where this came from, grepping throuth notmuchs soure didn't reveal the location. So this might be not specific to the pytho

[PATCH 7/9] python: provide more exception classes

2011-09-30 Thread Justus Winter
Quoting Sebastian Spaeth (2011-09-30 14:00:36) >On Mon, 26 Sep 2011 03:05:35 +0200, Justus Winter <4winter at >informatik.uni-hamburg.de> wrote: >> To make the exception handling more effective in code using the >> python bindings it is necessary to differentiate between

python(?): process died while iterating over Messages object

2011-09-30 Thread Justus Winter
Quoting Tom Prince (2011-09-30 15:12:50) >On Fri, 30 Sep 2011 12:43:53 +0200, Justus Winter <4winter at >informatik.uni-hamburg.de> wrote: >> while iterating over a query result set my process died with >> >> > terminate called after throwing an instance of &g

python: unpythonic result of Message.get_replies()

2011-10-05 Thread Justus Winter
Hi everyone :) I noticed that Message.get_replies() returns a Messages object *or* None. Quoting the documentation: > Returns: Messages or None if there are no replies to this message Messages is a class implementing the iterator protocol, so a python programmer would expect to get an iterator

[PATCH 1/2] python: add classes to wrap all notmuch_*_t types

2011-10-10 Thread Justus Winter
Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> --- bindings/python/notmuch/globals.py | 38 +++- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py

[PATCH 2/2] python: annotate all calls into libnotmuch with types

2011-10-10 Thread Justus Winter
Add type information to the ctypes._FuncPtr wrappers and use the wrapper classes instead of c_void_p for pointers to notmuch_*_t. This enables the ctypes library to type check parameters being handed to functions from the notmuch library. Signed-off-by: Justus Winter <4winter at informatik.

[PATCH 1/2] python: add classes to wrap all notmuch_*_t types

2011-11-28 Thread Justus Winter
Quoting Sebastian Spaeth (2011-11-02 08:25:53) >On Mon, 10 Oct 2011 00:12:53 +0200, Justus Winter <4winter at >informatik.uni-hamburg.de> wrote: >> Signed-off-by: Justus Winter <4winter at informatik.uni-hamburg.de> >> --- >> bindi

[PATCH 1/2] python: add classes to wrap all notmuch_*_t types

2011-12-02 Thread Justus Winter
Quoting James Westby (2011-12-02 00:32:30) >On Thu, 01 Dec 2011 22:25:41 +0100, Sebastian Spaeth >wrote: >> This strikes me as a rather good thing, so the patches went in. > >Hah, I've just seen this, and I'm going to guess that it fixes my >problems too. > >... > >I've tested and it seems to wor

[PATCH 1/2] python: add classes to wrap all notmuch_*_t types

2011-12-03 Thread Justus Winter
Quoting James Westby (2011-12-03 00:24:18) >On Fri, 02 Dec 2011 09:20:35 -0500, James Westby jameswestby.net> wrote: >> I'll test again to make sure that I have this correct, but my tests >> yesterday certainly suggested that your patches fixed this. > >Yep, segfaults a plenty dropping your second

RFC: don't ask users to do 'sudo make install'

2011-12-07 Thread Justus Winter
Hey everyone, I just noticed that running configure says: > All required packages were found. You may now run the following > commands to compile and install notmuch: > >make >sudo make install I think that this is a very poor advice in general and we shouldn't give it to users.

<    1   2   3   4   >