X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=bindings%2Fpython%2Fnotmuch%2Fdatabase.py;h=1db332fe333b0b83b79a3e6c004de8485d29ad63;hb=fcfb619b44b0011ac6bc557e6cbe2d516bc58f8a;hp=525f7c9a0ca9d0b2a933faa26185e3671e736e8f;hpb=162687a99e412098729d639ed7bc27f01372cb84;p=obsolete%2Fnotmuch-old diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index 525f7c9a..1db332fe 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -56,21 +56,14 @@ 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:: Any function in this class can and will throw an :exc:`NotInitializedError` if the database was not intitialized properly. - - .. note:: - - Do remember that as soon as we tear down (e.g. via `del db`) this - object, all underlying derived objects such as queries, threads, - messages, tags etc will be freed by the underlying library as well. - Accessing these objects will lead to segfaults and other unexpected - behavior. See above for more details. """ _std_db_path = None """Class attribute to cache user's default database""" @@ -225,6 +218,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)