From b6a01735d238733ef78f941a8b7c4bad59db2734 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 26 Sep 2011 03:05:35 +0200 Subject: 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 Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> --- bindings/python/notmuch/__init__.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'bindings/python/notmuch/__init__.py') diff --git a/bindings/python/notmuch/__init__.py b/bindings/python/notmuch/__init__.py index a7b558f..36e5fc7 100644 --- a/bindings/python/notmuch/__init__.py +++ b/bindings/python/notmuch/__init__.py @@ -50,13 +50,28 @@ for more details. You should have received a copy of the GNU General Public License along with notmuch. If not, see . -Copyright 2010 Sebastian Spaeth ' +Copyright 2010-2011 Sebastian Spaeth """ from notmuch.database import Database, Query from notmuch.message import Messages, Message from notmuch.thread import Threads, Thread from notmuch.tag import Tags -from notmuch.globals import nmlib, STATUS, NotmuchError +from notmuch.globals import ( + nmlib, + STATUS, + NotmuchError, + OutOfMemoryError, + ReadOnlyDatabaseError, + XapianError, + FileError, + FileNotEmailError, + DuplicateMessageIdError, + NullPointerError, + TagTooLongError, + UnbalancedFreezeThawError, + UnbalancedAtomicError, + NotInitializedError +) from notmuch.version import __VERSION__ __LICENSE__ = "GPL v3+" __AUTHOR__ = 'Sebastian Spaeth ' -- cgit v1.2.3