X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=bindings%2Fpython%2Fnotmuch%2Fglobals.py;h=de1db1617ae26a705c62caa457e7eea3b02943f1;hb=1915c14a3a0f947629687c686391d99ac9d3a988;hp=190854a1b9bc654acd9c91c3d710adefde34e987;hpb=8c51525e8213e074a845ad53d7196453952623dd;p=notmuch diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py index 190854a1..de1db161 100644 --- a/bindings/python/notmuch/globals.py +++ b/bindings/python/notmuch/globals.py @@ -23,7 +23,7 @@ from ctypes.util import find_library #----------------------------------------------------------------------------- #package-global instance of the notmuch library try: - nmlib = CDLL("libnotmuch.so.1") + nmlib = CDLL("libnotmuch.so.2") except: raise ImportError("Could not find shared 'notmuch' library.") @@ -143,27 +143,32 @@ class NotmuchError(Exception): # List of Subclassed exceptions that correspond to STATUS values and are # subclasses of NotmuchError. class OutOfMemoryError(NotmuchError): - pass + status = STATUS.OUT_OF_MEMORY class ReadOnlyDatabaseError(NotmuchError): - pass + status = STATUS.READ_ONLY_DATABASE class XapianError(NotmuchError): - pass + status = STATUS.XAPIAN_EXCEPTION class FileError(NotmuchError): - pass + status = STATUS.FILE_ERROR class FileNotEmailError(NotmuchError): - pass + status = STATUS.FILE_NOT_EMAIL class DuplicateMessageIdError(NotmuchError): - pass + status = STATUS.DUPLICATE_MESSAGE_ID class NullPointerError(NotmuchError): - pass + status = STATUS.NULL_POINTER class TagTooLongError(NotmuchError): - pass + status = STATUS.TAG_TOO_LONG class UnbalancedFreezeThawError(NotmuchError): - pass + status = STATUS.UNBALANCED_FREEZE_THAW class UnbalancedAtomicError(NotmuchError): - pass + status = STATUS.UNBALANCED_ATOMIC class NotInitializedError(NotmuchError): - pass + """Derived from NotmuchError, this occurs if the underlying data + structure (e.g. database is not initialized (yet) or an iterator has + been exhausted. You can test for NotmuchError with .status = + STATUS.NOT_INITIALIZED""" + status = STATUS.NOT_INITIALIZED + def _str(value):