notmuch.git
13 years agonotmuch-deliver: update gitignore
Ali Polatel [Mon, 10 Jan 2011 14:59:18 +0000 (16:59 +0200)]
notmuch-deliver: update gitignore

13 years agonotmuch-deliver: Don't read errno inappropriately.
Thomas Schwinge [Wed, 29 Dec 2010 19:35:02 +0000 (20:35 +0100)]
notmuch-deliver: Don't read errno inappropriately.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
13 years agonotmuch-deliver: Won't deliver to more than one folder.
Thomas Schwinge [Wed, 29 Dec 2010 19:31:41 +0000 (20:31 +0100)]
notmuch-deliver: Won't deliver to more than one folder.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
13 years agonotmuch-deliver: Advance imported files to maildrop-2.5.2 release.
Thomas Schwinge [Wed, 29 Dec 2010 11:14:45 +0000 (12:14 +0100)]
notmuch-deliver: Advance imported files to maildrop-2.5.2 release.

13 years agonotmuch-deliver: Import said files from maildrop-2.2.0 release.
Thomas Schwinge [Wed, 29 Dec 2010 11:02:29 +0000 (12:02 +0100)]
notmuch-deliver: Import said files from maildrop-2.2.0 release.

We won't use all of the included build infrastructure files, but adding them
nevertheless helps to track changes that are applied to them upstream.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
13 years agoMove files copied from maildrop to a separate hierarchy.
Thomas Schwinge [Wed, 29 Dec 2010 11:00:30 +0000 (12:00 +0100)]
Move files copied from maildrop to a separate hierarchy.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
13 years agoMake it build in a separate build directory.
Thomas Schwinge [Wed, 29 Dec 2010 10:57:53 +0000 (11:57 +0100)]
Make it build in a separate build directory.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
13 years agonotmuch-deliver: Add mailmap
Ali Polatel [Wed, 26 May 2010 11:32:27 +0000 (14:32 +0300)]
notmuch-deliver: Add mailmap

13 years agonotmuch-deliver: Fix utter failure
alip [Wed, 26 May 2010 14:27:30 +0000 (14:27 +0000)]
notmuch-deliver: Fix utter failure

13 years agonotmuch-deliver: Use splice() if it's available
Ali Polatel [Wed, 26 May 2010 11:21:15 +0000 (14:21 +0300)]
notmuch-deliver: Use splice() if it's available

NOTMUCH_DELIVER_NO_SPLICE environment variable may be set to fallback to
the read/write method.

13 years agonotmuch-deliver: Add --enable-{gprof,gcov} options to configure
Ali Polatel [Wed, 26 May 2010 10:04:53 +0000 (13:04 +0300)]
notmuch-deliver: Add --enable-{gprof,gcov} options to configure

13 years agoMore debug messages
Ali Polatel [Wed, 26 May 2010 07:55:39 +0000 (10:55 +0300)]
More debug messages

13 years agonotmuch-deliver: Fix typos in option context description
Ali Polatel [Wed, 26 May 2010 07:23:40 +0000 (10:23 +0300)]
notmuch-deliver: Fix typos in option context description

13 years agonotmuch-deliver: Fix copy/paste fail
Ali Polatel [Wed, 26 May 2010 07:13:03 +0000 (10:13 +0300)]
notmuch-deliver: Fix copy/paste fail

13 years agonotmuch-deliver: Initial import
Ali Polatel [Wed, 26 May 2010 07:09:47 +0000 (10:09 +0300)]
notmuch-deliver: Initial import

13 years agoemacs: Tab completion for notmuch-search and notmuch-search-filter
Daniel Schoepe [Tue, 9 Aug 2011 17:32:49 +0000 (19:32 +0200)]
emacs: Tab completion for notmuch-search and notmuch-search-filter

This patch adds completion with <tab> in the minibuffer for
notmuch-search and notmuch-search-filter.

13 years agolib/database.cc: use flush Xapian method instead of commit
David Bremner [Fri, 28 Oct 2011 14:56:30 +0000 (11:56 -0300)]
lib/database.cc: use flush Xapian method instead of commit

Apparently the method was renamed in Xapian 1.1.0 but the old method
name will stay around for a while. It seems better to stick with the
old name to make notmuch compile with older versions of Xapian, at
least for now.

13 years agoremove GCC visibility pragmas
Tomi Ollila [Mon, 31 Oct 2011 12:01:28 +0000 (14:01 +0200)]
remove GCC visibility pragmas

libnotmuch.so.* linking fail on some environments. According to
David Bremner on irc:
 "We jump through hoops with the linker script (notmuch.sym) so
 the pragmas are not needed. And they are a little bizarre in a
 library anyway..."

13 years agoxregcomp: don't consider every regex compilation failure an internal error.
David Bremner [Sun, 23 Oct 2011 20:52:19 +0000 (17:52 -0300)]
xregcomp: don't consider every regex compilation failure an internal error.

This pushes the error handling up one step, but makes the function
more flexible. Running out of memory still triggers an internal error,
in the spirit of other xutils functions.

13 years agoxutil.c: remove duplicate copies, create new library libutil.a to contain xutil.
David Bremner [Sun, 23 Oct 2011 15:05:13 +0000 (12:05 -0300)]
xutil.c: remove duplicate copies, create new library libutil.a to contain xutil.

We keep the lib/xutil.c version. As a consequence, also factor out
_internal_error and associated macros.  It might be overkill to make a
new file error_util.c for this, but _internal_error does not really
belong in database.cc.

13 years agobuild system: target to make a Debian snapshot package.
David Bremner [Thu, 13 Oct 2011 01:23:33 +0000 (22:23 -0300)]
build system: target to make a Debian snapshot package.

Currently this builds a native package, but since the source package
is throw away, it should not matter too much, except for the extra
warnings from lintian.

The extra +1 is so that if $(VERSION) is the same as the last released
version (for example outside a git repo) then the versions still order
correctly.

13 years agobuild system: remove dashes from git-describe generated version.
David Bremner [Thu, 13 Oct 2011 01:23:32 +0000 (22:23 -0300)]
build system: remove dashes from git-describe generated version.

This makes it less confusing with released Debian versions, now that we have
non-native Debian versions.

13 years agoemacs: Turn id:"<message-id>" elements into buttons for notmuch searches
Daniel Schoepe [Fri, 28 Oct 2011 14:48:58 +0000 (16:48 +0200)]
emacs: Turn id:"<message-id>" elements into buttons for notmuch searches

This fixes the minor annoyance that message ids were parsed as mail
addresses by goto-address-mode in notmuch-show buffers.

13 years agoSeparate Emacs misc. files dir. from Emacs code dir.
Amadeusz Żołnowski [Tue, 25 Oct 2011 08:07:02 +0000 (10:07 +0200)]
Separate Emacs misc. files dir. from Emacs code dir.

New option --emacsetcdir was added, but it's set default to the same
value as --emacslispdir for backward compatibility.

13 years agoPrefix lib/notmuch.h and lib/gen-version-script.sh with $(srcdir)
Amadeusz Żołnowski [Sun, 23 Oct 2011 14:44:01 +0000 (16:44 +0200)]
Prefix lib/notmuch.h and lib/gen-version-script.sh with $(srcdir)

lib/notmuch.h and lib/gen-version-script.sh couldn't have been found
when building out of sources directory.

13 years agodocs: Update news, man page, and online help for restore --accumulate
David Bremner [Fri, 21 Oct 2011 22:09:49 +0000 (19:09 -0300)]
docs: Update news, man page, and online help for restore --accumulate

As a side effect, reformat the NEWs entry for notmuch dump for
consistency with the notmuch restore NEWS submitted by Thomas
Schwinge.

13 years agonotmuch-restore: check for extra arguments.
David Bremner [Fri, 21 Oct 2011 18:46:54 +0000 (15:46 -0300)]
notmuch-restore: check for extra arguments.

We consider it an error to pass more than one file to restore, since
extra ones are ignored.

13 years agonotmuch-restore: implement --accumulate option
David Bremner [Wed, 19 Oct 2011 21:18:24 +0000 (18:18 -0300)]
notmuch-restore: implement --accumulate option

Modify command line argument handling to take a --accumulate flag.
Test for extra arguments beyond the input file.

The --accumulate switch causes the union of the existing and new tags to be
applied, instead of replacing each message's tags as they are read in from the
dump file.

Based on a patch by Thomas Schwinge:

      id:"1317317857-29636-1-git-send-email-thomas@schwinge.name"

13 years agotest/dump-restore: add tests for restore --accumulate
David Bremner [Fri, 21 Oct 2011 16:04:46 +0000 (13:04 -0300)]
test/dump-restore: add tests for restore --accumulate

Flesh out what ``notmuch restore --accumulate'' is supposed to do.
Its tests are currently XFAILed; the functionality will be added in
future patch(es).

Based on a patch by Thomas Schwinge:

      id:"1317317811-29540-1-git-send-email-thomas@schwinge.name"

13 years agonotmuch.1: typo fixes new wording for dump/restore
David Bremner [Fri, 21 Oct 2011 22:08:11 +0000 (19:08 -0300)]
notmuch.1: typo fixes new wording for dump/restore

These changes were included in Thomas's restore --accumulate patch,
but are actually more generally applicable.

13 years agotest/dump-restore: Fix quoting on grep
David Bremner [Fri, 21 Oct 2011 00:14:30 +0000 (21:14 -0300)]
test/dump-restore: Fix quoting on grep

Thanks to Thomas Schwinge for noticing yet another place where quoting
matters. Since the shell translates \. to ., the regex passed to grep
is too generous without the quotes.

The use of [.] is the suggestion of Tomi Ollila.

13 years agotest/dump-restore: expand test suite for dump-restore, make more robust
David Bremner [Wed, 19 Oct 2011 21:03:12 +0000 (18:03 -0300)]
test/dump-restore: expand test suite for dump-restore, make more robust

Several new tests are added, and existing use of test_begin_subtest is
replaced by test_expect_success to catch failing commands in cases where
we execute more than one command.

Based on changes in

      id:"1317317811-29540-1-git-send-email-thomas@schwinge.name"

13 years agotest/test-lib.sh: update comments
David Bremner [Wed, 19 Oct 2011 20:51:24 +0000 (17:51 -0300)]
test/test-lib.sh: update comments

- explain test_expect_equal_file
- remove mention of test_expect_failure, since that function was removed.

Based on id:"1317317811-29540-1-git-send-email-thomas@schwinge.name"

13 years agocli: change argument parsing convention for subcommands
David Bremner [Fri, 21 Oct 2011 12:19:17 +0000 (09:19 -0300)]
cli: change argument parsing convention for subcommands

previously we deleted the subcommand name from argv before passing to
the subcommand. In this version, the deletion is done in the actual
subcommands. Although this causes some duplication of code, it allows
us to be more flexible about how we parse command line arguments in
the subcommand, including possibly using off-the-shelf routines like
getopt_long that expect the name of the command in argv[0].

13 years agodocs: Update man page, NEWS and online help for new dump arguments.
David Bremner [Wed, 12 Oct 2011 21:34:43 +0000 (18:34 -0300)]
docs: Update man page, NEWS and online help for new dump arguments.

We mention in all three places that using the filename argument is
deprecated.

13 years agonotmuch-dump: deprecate use of output file argument.
David Bremner [Mon, 10 Oct 2011 13:44:07 +0000 (10:44 -0300)]
notmuch-dump: deprecate use of output file argument.

We print an intentionally non-specific message on stderr, since it
isn't clear if there will be some global output file argument to
replace.

We update the test suite atomically, since it relies on having the
same text in two files.

13 years agonotmuch-dump: treat any remaining arguments after the filename as search terms
David Bremner [Sun, 9 Oct 2011 14:12:30 +0000 (11:12 -0300)]
notmuch-dump: treat any remaining arguments after the filename as search terms

The main motivation here is allow the fast dumping of tag data for
messages having certain tags.  In practice it seems too slow to pipe
dump to grep.

All dump-restore tests should be working now, so we update test/dump-restore
accordingly

13 years agonotmuch-dump: update handling of file name argument
David Bremner [Sun, 9 Oct 2011 13:57:03 +0000 (10:57 -0300)]
notmuch-dump: update handling of file name argument

We permit -- as an "option processing terminator".

Currently this does not do anything useful, but we plan to add
search terms after the --.

13 years agotest: add tests for command line arguments to notmuch-dump
David Bremner [Mon, 10 Oct 2011 12:27:20 +0000 (09:27 -0300)]
test: add tests for command line arguments to notmuch-dump

The plan is to add the possibility of search terms after the file name,
and the use of -- to stop looking for an output file name.

13 years agotest: update dump-restore to use redirection instead of filename args
David Bremner [Sun, 9 Oct 2011 13:29:22 +0000 (10:29 -0300)]
test: update dump-restore to use redirection instead of filename args

The idea here is that we want to deprecate the use of arguments to
dump and restore to specify paths, since in particular we want to use
the non-option arguments to dump to form a query.

13 years agodebian: changelog stanza for 0.9 0.9
David Bremner [Wed, 12 Oct 2011 00:53:57 +0000 (21:53 -0300)]
debian: changelog stanza for 0.9

Admit that there have been no changes since the last release
candidate.

13 years agoversion: bump to 0.9
David Bremner [Wed, 12 Oct 2011 00:50:56 +0000 (21:50 -0300)]
version: bump to 0.9

also bump python bindings version.

13 years agoNEWS: document API changes to n_d_find_message{,_by_filename}
David Bremner [Tue, 11 Oct 2011 12:10:33 +0000 (09:10 -0300)]
NEWS: document API changes to n_d_find_message{,_by_filename}

For details the user will have to refer to the source.  Reformat Ruby
news consistently with Python.

13 years agoNEWS: document API changes to n_d_find_message{,_by_filename}
David Bremner [Tue, 11 Oct 2011 12:05:41 +0000 (09:05 -0300)]
NEWS: document API changes to n_d_find_message{,_by_filename}

For details the user will have to refer to the source.

13 years agotest: add two emacs tests for show mode refresh
Jameson Graef Rollins [Sun, 9 Oct 2011 03:21:26 +0000 (20:21 -0700)]
test: add two emacs tests for show mode refresh

The first test tests that the notmuch-show-refresh-view function
produces the exact same output for an unmodified show buffer.  This
test should pass since the relevant functionality has already been
applied.

The second test tests show refresh for a show buffer that has been
modified by navigation and message visibility toggling.  Ideally
refresh-view should preserve this state of the notmuch-show buffer.
Unfortunately it currently does not, so this test is know to be broken
and is marked as such.

13 years agoNEWS: add notes about emacs improvements and reply formating cleanup
Jameson Graef Rollins [Sun, 9 Oct 2011 03:47:47 +0000 (20:47 -0700)]
NEWS: add notes about emacs improvements and reply formating cleanup

13 years agoversion: bump to 0.9~rc2
David Bremner [Sat, 8 Oct 2011 01:42:18 +0000 (22:42 -0300)]
version: bump to 0.9~rc2

We continue to keep the python bindings version in sync manually

13 years agodebian: update changelog for 0.9~rc2-1
David Bremner [Fri, 7 Oct 2011 21:54:27 +0000 (18:54 -0300)]
debian: update changelog for 0.9~rc2-1

Document upstream changes since 0.9~rc1-1

13 years agoemacs: add notmuch-show-refresh-view function
Jameson Graef Rollins [Sun, 29 May 2011 00:09:43 +0000 (17:09 -0700)]
emacs: add notmuch-show-refresh-view function

This function, like the equivalent for notmuch-search, just refreshes
the current show view.  Like in notmuch-search, this new function is
bound to "=".  If a prefix is given then the redisplay happens with the
crypto-switch set, which displays the thread with the opposite logic
of whatever is set in the notmuch-crypto-process-mime customization
variable.

13 years agoemacs: Add callback functions to crypto sigstatus button.
Jameson Graef Rollins [Tue, 31 May 2011 17:07:13 +0000 (10:07 -0700)]
emacs: Add callback functions to crypto sigstatus button.

This adds two callback functions to the sigstatus button.  If the sig
status is "good", then clicking the button displays the output of "gpg
--list-keys" on the key fingerprint.  If the sigstatus is "bad", then
clicking the button will retrieve the key from the keyserver, and
redisplay the current buffer.

Thanks to David Bremner <bremner@unb.ca> for help with this.

13 years agoIgnore "application/pgp-*" parts in reply.
Jameson Graef Rollins [Wed, 8 Jun 2011 19:30:09 +0000 (12:30 -0700)]
Ignore "application/pgp-*" parts in reply.

The quoted text doesn't need to mention that the message being replied
to had these crufty parts.

13 years agotest: test for absence of "Non-text part: application/pgp-*" lines in reply
Jameson Graef Rollins [Wed, 8 Jun 2011 19:30:08 +0000 (12:30 -0700)]
test: test for absence of "Non-text part: application/pgp-*" lines in reply

In reply, the quoted text does not need to mention that the original
message had "application/pgp-signed" or "application/pgp-encrypted"
parts.

13 years agoFix notmuch-reply to not output "Non-text part:" lines for non-leafnode parts.
Jameson Graef Rollins [Wed, 8 Jun 2011 19:30:07 +0000 (12:30 -0700)]
Fix notmuch-reply to not output "Non-text part:" lines for non-leafnode parts.

These lines are just cruft in this case, and can be removed.

13 years agotest/multipart: test for absence of "Non-text part:" lines in reply for multipart...
Jameson Graef Rollins [Wed, 8 Jun 2011 19:30:06 +0000 (12:30 -0700)]
test/multipart: test for absence of "Non-text part:" lines in reply for multipart/* and message/rfc822 parts

There's no reason to output "Non-text part:" lines for parts that are
not leaf nodes, eg. multipart/* and message/rfc822.  We fix the text
here to test for their absence.  The next patch will fix reply
accordingly.

13 years agopython: Set status in the class definitions
Sebastian Spaeth [Wed, 5 Oct 2011 15:57:46 +0000 (17:57 +0200)]
python: Set status in the class definitions

Technically, this is a superfluous change, as the self.status variable
currently gets set in NotmuchErrors's __new__ function. However, in the
long run I would like to get rid of the weird __new__ implementation which
might be somewhat confusing for users (NotmuchError(status) returns a
different class, e.g. OutOfMemoryError)

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: help function Query._assert_query_is_initialized
Sebastian Spaeth [Wed, 5 Oct 2011 15:55:30 +0000 (17:55 +0200)]
python: help function Query._assert_query_is_initialized

Remove code duplication by using the new helper function. Also raise the
new fine grained exceptions in many cases, rather than the more generic
NotmuchErrors.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: clean up docstrings and API documentation
Sebastian Spaeth [Wed, 5 Oct 2011 15:54:09 +0000 (17:54 +0200)]
python: clean up docstrings and API documentation

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: whitespace fixed in docstrings
Sebastian Spaeth [Wed, 5 Oct 2011 15:05:37 +0000 (17:05 +0200)]
python: whitespace fixed in docstrings

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: Add the new exception types in the API documentation
Sebastian Spaeth [Wed, 5 Oct 2011 14:58:13 +0000 (16:58 +0200)]
python: Add the new exception types in the API documentation

as they should be documented...

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: Catch up with find_message(by_filename) API changes
Sebastian Spaeth [Wed, 5 Oct 2011 14:44:35 +0000 (16:44 +0200)]
python: Catch up with find_message(by_filename) API changes

message is now an out parameter, and we get an additional status code as
a result. Hurray \o/.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: also use libnotmuch.so.2
Sebastian Spaeth [Wed, 5 Oct 2011 13:46:03 +0000 (15:46 +0200)]
python: also use libnotmuch.so.2

Catch up with the major version bump. I wonder if this could somehow be
automatically made the correct version number. Oh well, I hope it
doesn't change too often :-).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agodebian: update packaging for new soname
David Bremner [Tue, 4 Oct 2011 17:01:21 +0000 (14:01 -0300)]
debian: update packaging for new soname

we need
   - a new changelog stanza, because the symbols files need a new version
   - s/libnotmuch1/libnotmuch2/ everywhere
   - update symbols file, s/.so.1/.so.2/, and bump minimum versions on changed
     symbols (although the latter is just documentation)

13 years agolib: bump SONAME
David Bremner [Tue, 4 Oct 2011 16:47:04 +0000 (13:47 -0300)]
lib: bump SONAME

Based on discussions with amdragon, tschwinge, and others on IRC, I concluded that

1) symbol versioning was probably overkill for libnotmuch
2) It was also probably GNU ld specific
3) Most importantly, nobody could tell me on short notice how exactly it works.

So since the change to the notmuch_database_find_message breaks the
previous ABI, we need to bump the SONAME.

13 years agoruby: Fix macros, use quoting
Ali Polatel [Tue, 4 Oct 2011 13:57:33 +0000 (16:57 +0300)]
ruby: Fix macros, use quoting

Fix Data_Get_Notmuch_* macro definitions broken by prev. commit
Adequate quoting for Data_Get_Notmuch_* macros
Remove duplicated RSTRING_PTR() macros, move it to defs.h

13 years agoruby: Really add wrappers for database_find_message*
Ali Polatel [Tue, 4 Oct 2011 13:48:34 +0000 (16:48 +0300)]
ruby: Really add wrappers for database_find_message*

Commit 898613116db746aa0f915ae43da8aba28545203d only added wrapper
functions but did not register them. Register the functions in module's
initialization function.

13 years agoruby: be consistent with notmuch's coding style
Ali Polatel [Tue, 4 Oct 2011 13:41:52 +0000 (16:41 +0300)]
ruby: be consistent with notmuch's coding style

No functional change, just indentation

13 years agoruby: Add wrappers for database_find_message*
Ali Polatel [Tue, 4 Oct 2011 13:06:20 +0000 (16:06 +0300)]
ruby: Add wrappers for database_find_message*

Two new wrappers:
Notmuch::Database.find_message(id) => Notmuch::Message or nil
Notmuch::Database.find_message_by_filename(path) => Notmuch::Message or nil

13 years agoMerge remote-tracking branch 'alip/find_message-v3'
David Bremner [Tue, 4 Oct 2011 10:35:40 +0000 (07:35 -0300)]
Merge remote-tracking branch 'alip/find_message-v3'

13 years agolib: make find_message{,by_filename) report errors
Ali Polatel [Tue, 4 Oct 2011 04:55:29 +0000 (07:55 +0300)]
lib: make find_message{,by_filename) report errors

Previously, the functions notmuch_database_find_message() and
notmuch_database_find_message_by_filename() functions did not properly
report error condition to the library user.

For more information, read the thread on the notmuch mailing list
starting with my mail "id:871uv2unfd.fsf@gmail.com"

Make these functions accept a pointer to 'notmuch_message_t' as argument
and return notmuch_status_t which may be used to check for any error
condition.

restore: Modify for the new notmuch_database_find_message()
new: Modify for the new notmuch_database_find_message_by_filename()

13 years agolib: destroy message object after message removal
Ali Polatel [Mon, 3 Oct 2011 20:27:32 +0000 (23:27 +0300)]
lib: destroy message object after message removal

notmuch_database_remove_message() must call notmuch_message_destroy()
once it is done handling message removal.

13 years agopython: fix Message.get_filenames()
Thomas Jost [Fri, 30 Sep 2011 10:16:47 +0000 (12:16 +0200)]
python: fix Message.get_filenames()

Previously, the Filenames generator only yielded *one* filename before
returning, making Message.get_filenames() behave as Message.get_filename(). This
commit fixes this incorrect behavior: now the generator yields all the
filenames, as expected.

13 years agopython: rework creating of Subclasses
Sebastian Spaeth [Fri, 30 Sep 2011 14:04:42 +0000 (16:04 +0200)]
python: rework creating of Subclasses

Add some smart magic, so that when we invoke a
NotmuchError(STATUSVALUE), a nicely derived subclass is created, e.g. a
OutOfMemoryError. This way users can easily distinguish between error
types, while still catching NotmuchError.

I have tested this, and hope it works for others too.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: provide more exception classes
Justus Winter [Mon, 26 Sep 2011 01:05:35 +0000 (03:05 +0200)]
python: provide more exception classes

To make the exception handling more effective in code using the
python bindings it is necessary to differentiate between the
different kind of failures.

Add an exception class for each status code and add a decode
classmethod to the NotmuchError class that acts as a factory.

Import the new classes in __init__.py so they can be easily
imported by anyone.

Patch modifed by Sebastian Spaeth.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: fix docstring of Message.get_header()
Justus Winter [Fri, 30 Sep 2011 01:05:04 +0000 (03:05 +0200)]
python: fix docstring of Message.get_header()

Update the docstring from notmuch.h.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: Add new functions in API documentation
Sebastian Spaeth [Thu, 29 Sep 2011 09:00:43 +0000 (11:00 +0200)]
python: Add new functions in API documentation

Add documentation for the three new functions and add in which version
they have been added.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: Improve code documentation
Sebastian Spaeth [Thu, 29 Sep 2011 08:47:28 +0000 (10:47 +0200)]
python: Improve code documentation

1) Fix added .gitignore from commit dc8a1745 to work on the docs folder
2) Improve in-code developer documentation to produce better
   sphinx-generated documentation. No code changes.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoNEWS: Note implementation bug for python binding
Sebastian Spaeth [Thu, 29 Sep 2011 07:55:14 +0000 (09:55 +0200)]
NEWS: Note implementation bug for python binding

Make note that find_message_by_name currently crashes the python process
if the Database is READ-ONLY. This should be fixed in the underlying
libnotmuch.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoNEWS: Update with python binding news
Sebastian Spaeth [Thu, 29 Sep 2011 07:51:42 +0000 (09:51 +0200)]
NEWS: Update with python binding news

List major changes.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoproperly raise exceptions in python bindings
Justus Winter [Sun, 25 Sep 2011 21:07:35 +0000 (23:07 +0200)]
properly raise exceptions in python bindings

There are various locations where exceptions are constructed but
not raised. This patch adds the necessary raise statements.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: raise a more specific error in Messages.print_messages
Justus Winter [Mon, 26 Sep 2011 01:05:37 +0000 (03:05 +0200)]
python: raise a more specific error in Messages.print_messages

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 <4winter@informatik.uni-hamburg.de>
13 years agopython: rename _verify_dir_initialized to _assert_dir_is_initialized
Justus Winter [Mon, 26 Sep 2011 01:05:34 +0000 (03:05 +0200)]
python: rename _verify_dir_initialized to _assert_dir_is_initialized

Rename the function to clarify its effect and remove all the comments
accompanying each call to the function.

Modified by Sebastian Spaeth to apply cleanly again and remove some
blank lines.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: rename _verify_initialized_db to _assert_db_is_initialized
Justus Winter [Mon, 26 Sep 2011 01:05:33 +0000 (03:05 +0200)]
python: rename _verify_initialized_db to _assert_db_is_initialized

Rename the function to clarify its effect and remove all the comments
accompanying each call to the function.

Modified slightly by Sebastian Spaeth to catch all new instances and
remove some blank lines too.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: fix NotmuchError.__str__ if status == None
Justus Winter [Mon, 26 Sep 2011 01:05:32 +0000 (03:05 +0200)]
python: fix NotmuchError.__str__ if status == None

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@informatik.uni-hamburg.de>
13 years agopython: add status and message attributes to NotmuchError
Justus Winter [Mon, 26 Sep 2011 01:05:30 +0000 (03:05 +0200)]
python: add status and message attributes to NotmuchError

Providing exception objects with meaningful attribute names
is much nicer than using e.args[].

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: add a .gitignore file and refine the toplevel one
Justus Winter [Mon, 26 Sep 2011 01:05:29 +0000 (03:05 +0200)]
python: add a .gitignore file and refine the toplevel one

The line 'notmuch' in the toplevel .gitignore file is to broad
and matches bindings/python/notmuch making it cumbersome to
git-add files within that directory.

Refine the toplevel file to only match the generated notmuch
executable and add a more specialized .gitignore file to the
python directory.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
13 years agopython: add begin|end_atomic bindings
Sebastian Spaeth [Wed, 28 Sep 2011 15:50:57 +0000 (17:50 +0200)]
python: add begin|end_atomic bindings

* Add UNBALANCED_ATOMIC status code
  Catch up with the notmuch status codes, and add the UNBALANCED_ATOMIC
  one.
* Add the begin_atomic and end_atomic calls to libnotmuch

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: Add database_find_message_by_filename bindings
Sebastian Spaeth [Wed, 28 Sep 2011 16:27:44 +0000 (18:27 +0200)]
python: Add database_find_message_by_filename bindings

Add it :-)

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoNEWS: add item for python bindings.
David Bremner [Mon, 26 Sep 2011 23:27:42 +0000 (20:27 -0300)]
NEWS: add item for python bindings.

Just the one unicode related change this release.

13 years agoNEWS: add item for Ruby bindings.
David Bremner [Mon, 26 Sep 2011 23:23:23 +0000 (20:23 -0300)]
NEWS: add item for Ruby bindings.

This is based on a quick scan of git log.

13 years agoNEWS: start release notes for 0.9
David Bremner [Mon, 26 Sep 2011 23:18:55 +0000 (20:18 -0300)]
NEWS: start release notes for 0.9

Thanks to Austin Clements for providing these notes, and the patches
they describe.

13 years agodebian: add brief summary of changes since 0.8 0.9_rc1 debian/0.9_rc1-1
David Bremner [Sun, 25 Sep 2011 14:27:03 +0000 (11:27 -0300)]
debian: add brief summary of changes since 0.8

13 years agodebian: build-depend on gdb
David Bremner [Sun, 25 Sep 2011 14:16:06 +0000 (11:16 -0300)]
debian: build-depend on gdb

This is needed to enable the atomicity tests at build time.

13 years agotest/atomicity: redirect output from "which"
David Bremner [Sun, 25 Sep 2011 12:12:48 +0000 (09:12 -0300)]
test/atomicity: redirect output from "which"

Without redirection, this produced some slightly confusing output in
case gdb was present.

13 years agodebian: close bug 642240
David Bremner [Sun, 25 Sep 2011 02:15:01 +0000 (23:15 -0300)]
debian: close bug 642240

The bug was really closed by the commit that updated the dependency,
of course.

13 years agotest: make atomicity setup conditional on gdb being present.
David Bremner [Sun, 25 Sep 2011 01:45:33 +0000 (22:45 -0300)]
test: make atomicity setup conditional on gdb being present.

The setup is useless if gdb is not present, so it doesn't hurt to skip
it.  The diff here is huge, but the commit is really just moving most
of the script inside the initial if, and adding an else block to print
a warning.

13 years agolib: bump library minor version because of new symbols.
David Bremner [Sat, 24 Sep 2011 19:13:49 +0000 (16:13 -0300)]
lib: bump library minor version because of new symbols.

This bump is because of the new symbols introduced by the atomicity
patches.

13 years agodebian: set versioned dependency on notmuch for notmuch-emacs
David Bremner [Sat, 24 Sep 2011 18:37:27 +0000 (14:37 -0400)]
debian: set versioned dependency on notmuch for notmuch-emacs

As long as we have no version information in the json output, this
seems like the only possible way of ensuring that the emacs client
code understands the output from the command line tool notmuch.

13 years agoversion: bump to 0.9~rc1
David Bremner [Sat, 24 Sep 2011 16:19:32 +0000 (12:19 -0400)]
version: bump to 0.9~rc1

This version number change should not be taken as definitive, rather
refer to the signed tag.

13 years agodebian: changlog stanza for release candidate
David Bremner [Sat, 24 Sep 2011 16:15:47 +0000 (12:15 -0400)]
debian: changlog stanza for release candidate

13 years agodebian: new symbols for atomicity api
David Bremner [Sat, 24 Sep 2011 18:17:44 +0000 (14:17 -0400)]
debian: new symbols for atomicity api

There are three new symbols in libnotmuch. In addition to notmuch_{begin,end)_atomic,
notmuch_database_find_message_by_filename was exposed.