]> git.cworth.org Git - obsolete/notmuch-old/commitdiff
python: document the Database.close function
authorJustus Winter <4winter@informatik.uni-hamburg.de>
Mon, 30 Apr 2012 17:48:45 +0000 (19:48 +0200)
committerJustus Winter <4winter@informatik.uni-hamburg.de>
Mon, 30 Apr 2012 17:48:45 +0000 (19:48 +0200)
Put a prominent warning into the docstring of Database.close, make the
function show up in the sphinx doc and refer to the warning in the
paragraph mentioning the context manager protocol.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
bindings/python/docs/source/database.rst
bindings/python/notmuch/database.py

index ee71085f8ea9de7bf255c39c7103c13da3b0f816..2464bffff3273c805928555afcf51b3c5203c508 100644 (file)
@@ -9,6 +9,8 @@
 
    .. automethod:: open(path, status=MODE.READ_ONLY)
 
+   .. automethod:: close
+
    .. automethod:: get_path
 
    .. automethod:: get_version
index 525f7c9a0ca9d0b2a933faa26185e3671e736e8f..5c62d4572308dac012e05767578e99850c76016a 100644 (file)
@@ -56,7 +56,8 @@ class Database(object):
 
     :class:`Database` objects implement the context manager protocol
     so you can use the :keyword:`with` statement to ensure that the
-    database is properly closed.
+    database is properly closed. See :meth:`close` for more
+    information.
 
     .. note::
 
@@ -225,6 +226,13 @@ class Database(object):
     def close(self):
         '''
         Closes the notmuch database.
+
+        .. warning::
+
+            This function closes the notmuch database. From that point
+            on every method invoked on any object ever derived from
+            the closed database may cease to function and raise a
+            NotmuchError.
         '''
         if self._db:
             self._close(self._db)