]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python/notmuch/database.py
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / bindings / python / notmuch / database.py
index a1ae14fc40ccbc11608034b874ca7a3cd94436f0..8fb507fafc1bfad1b246775470129061e2a1ab0c 100644 (file)
@@ -65,7 +65,7 @@ class Database(object):
     .. note::
 
         Any function in this class can and will throw an
-        :exc:`NotInitializedError` if the database was not intitialized
+        :exc:`NotInitializedError` if the database was not initialized
         properly.
     """
     _std_db_path = None
@@ -273,9 +273,9 @@ class Database(object):
         return Database._get_version(self._db)
 
     def get_revision (self):
-        """Returns the committed database revison and UUID
+        """Returns the committed database revision and UUID
 
-        :returns: (revison, uuid) The database revision as a positive integer
+        :returns: (revision, uuid) The database revision as a positive integer
         and the UUID of the database.
         """
         self._assert_db_is_initialized()
@@ -566,7 +566,7 @@ class Database(object):
         :returns: :class:`Message` or `None` if no message is found.
         :raises:
             :exc:`OutOfMemoryError`
-                  If an Out-of-memory occured while constructing the message.
+                  If an Out-of-memory occurred while constructing the message.
             :exc:`XapianError`
                   In case of a Xapian Exception. These exceptions
                   include "Database modified" situations, e.g. when the
@@ -574,7 +574,7 @@ class Database(object):
                   in the meantime. In this case, you should close and
                   reopen the database and retry.
             :exc:`NotInitializedError` if
-                    the database was not intitialized.
+                    the database was not initialized.
         """
         self._assert_db_is_initialized()
         msg_p = NotmuchMessageP()
@@ -591,7 +591,7 @@ class Database(object):
             function returns None if no message is found with the given
             filename.
 
-        :raises: :exc:`OutOfMemoryError` if an Out-of-memory occured while
+        :raises: :exc:`OutOfMemoryError` if an Out-of-memory occurred while
                  constructing the message.
         :raises: :exc:`XapianError` in case of a Xapian Exception.
                  These exceptions include "Database modified"
@@ -600,7 +600,7 @@ class Database(object):
                  case, you should close and reopen the database and
                  retry.
         :raises: :exc:`NotInitializedError` if the database was not
-                 intitialized.
+                 initialized.
 
         *Added in notmuch 0.9*"""
         self._assert_db_is_initialized()
@@ -616,7 +616,7 @@ class Database(object):
         """Returns :class:`Tags` with a list of all tags found in the database
 
         :returns: :class:`Tags`
-        :execption: :exc:`NotmuchError` with :attr:`STATUS`.NULL_POINTER
+        :exception: :exc:`NotmuchError` with :attr:`STATUS`.NULL_POINTER
                     on error
         """
         self._assert_db_is_initialized()
@@ -675,7 +675,10 @@ class Database(object):
         if not config.has_option('database', 'path'):
             raise NotmuchError(message="No DB path specified"
                                        " and no user default found")
-        return config.get('database', 'path')
+        db_path = config.get('database', 'path')
+        if not os.path.isabs(db_path):
+            db_path = os.path.expanduser(os.path.join("~", db_path))
+        return db_path
 
     """notmuch_database_get_config"""
     _get_config = nmlib.notmuch_database_get_config