aboutsummaryrefslogtreecommitdiff
path: root/bindings/python/docs
diff options
context:
space:
mode:
authorDavid Bremner <bremner@debian.org>2011-12-16 16:46:20 -0400
committerDavid Bremner <bremner@debian.org>2011-12-16 16:46:20 -0400
commit90259bf961eeacb89dfd2e73526a931e530cabd8 (patch)
treec8c5d57ebba3f82e372e8d2670257ac01d68fca4 /bindings/python/docs
parent8c0cb84ecce40ded56f9c551b2ef791caa9be7cf (diff)
parent07bb8b9e895541006eca88430925f1c6524c4708 (diff)
Merge commit 'debian/0.10.2-1' into squeeze-backports
Conflicts: debian/changelog
Diffstat (limited to 'bindings/python/docs')
-rw-r--r--bindings/python/docs/source/index.rst29
-rw-r--r--bindings/python/docs/source/status_and_errors.rst28
2 files changed, 46 insertions, 11 deletions
diff --git a/bindings/python/docs/source/index.rst b/bindings/python/docs/source/index.rst
index e9f39eb0..73d2a3b0 100644
--- a/bindings/python/docs/source/index.rst
+++ b/bindings/python/docs/source/index.rst
@@ -21,7 +21,13 @@ Notmuch can be imported as::
or::
- from notmuch import Query,Database
+ from notmuch import Query, Database
+
+ db = Database('path',create=True)
+ msgs = Query(db,'from:myself').search_messages()
+
+ for msg in msgs:
+ print (msg)
More information on specific topics can be found on the following pages:
@@ -36,8 +42,6 @@ More information on specific topics can be found on the following pages:
.. automodule:: notmuch
-:todo: Document nmlib,STATUS
-
:class:`notmuch.Database` -- The underlying notmuch database
---------------------------------------------------------------------
@@ -55,6 +59,10 @@ More information on specific topics can be found on the following pages:
.. automethod:: upgrade
+ .. automethod:: begin_atomic
+
+ .. automethod:: end_atomic
+
.. automethod:: get_directory
.. automethod:: add_message
@@ -63,13 +71,12 @@ More information on specific topics can be found on the following pages:
.. automethod:: find_message
+ .. automethod:: find_message_by_filename
+
.. automethod:: get_all_tags
.. automethod:: create_query
- .. note:: :meth:`create_query` was broken in release
- 0.1 and is fixed since 0.1.1.
-
.. attribute:: Database.MODE
Defines constants that are used as the mode in which to open a database.
@@ -82,6 +89,7 @@ More information on specific topics can be found on the following pages:
.. autoattribute:: db_p
+
:class:`notmuch.Query` -- A search query
-------------------------------------------------
@@ -130,7 +138,7 @@ More information on specific topics can be found on the following pages:
.. method:: __len__()
- .. note:: :meth:`__len__` was removed in version 0.6 as it exhausted
+ .. warning:: :meth:`__len__` was removed in version 0.6 as it exhausted
the iterator and broke list(Messages()). Use the
:meth:`Query.count_messages` function or use
`len(list(msgs))`.
@@ -195,7 +203,12 @@ More information on specific topics can be found on the following pages:
.. autoclass:: Tags
:members:
- .. automethod:: __len__
+ .. method:: __len__
+
+ .. warning:: :meth:`__len__` was removed in version 0.6 as it
+ exhausted the iterator and broke list(Tags()). Use
+ :meth:`len(list(msgs))` instead if you need to know the
+ number of tags.
.. automethod:: __str__
diff --git a/bindings/python/docs/source/status_and_errors.rst b/bindings/python/docs/source/status_and_errors.rst
index 1d74ba17..bc0d0d23 100644
--- a/bindings/python/docs/source/status_and_errors.rst
+++ b/bindings/python/docs/source/status_and_errors.rst
@@ -15,9 +15,31 @@ Some methods return a status, indicating if an operation was successful and what
:exc:`NotmuchError` -- A Notmuch execution error
------------------------------------------------
-Whenever an error occurs, we throw a special Exception:
+Whenever an error occurs, we throw a special Exception :exc:`NotmuchError`, or a more fine grained Exception which is derived from it. This means it is always safe to check for NotmuchErrors if you want to catch all errors. If you are interested in more fine grained exceptions, you can use those below.
.. autoexception:: NotmuchError
- :members:
- This execption inherits directly from :exc:`Exception` and is raised on errors during the notmuch execution.
+The following exceptions are all directly derived from NotmuchError. Each of them corresponds to a specific :class:`notmuch.STATUS` value. You can either check the :attr:`status` attribute of a NotmuchError to see if a specific error has occurred, or you can directly check for the following Exception types:
+
+.. autoexception:: OutOfMemoryError(message=None)
+ :members:
+.. autoexception:: ReadOnlyDatabaseError(message=None)
+ :members:
+.. autoexception:: XapianError(message=None)
+ :members:
+.. autoexception:: FileError(message=None)
+ :members:
+.. autoexception:: FileNotEmailError(message=None)
+ :members:
+.. autoexception:: DuplicateMessageIdError(message=None)
+ :members:
+.. autoexception:: NullPointerError(message=None)
+ :members:
+.. autoexception:: TagTooLongError(message=None)
+ :members:
+.. autoexception:: UnbalancedFreezeThawError(message=None)
+ :members:
+.. autoexception:: UnbalancedAtomicError(message=None)
+ :members:
+.. autoexception:: NotInitializedError(message=None)
+ :members: