aboutsummaryrefslogtreecommitdiff
path: root/bindings/python
diff options
context:
space:
mode:
authorDoan Tran Cong Danh <congdanhqx@gmail.com>2019-04-19 10:56:59 +0700
committerDavid Bremner <david@tethera.net>2019-04-24 07:10:53 -0300
commit816633e636d7d512506105632c98c10c587f8890 (patch)
tree68c57f0171fec31c6907a5f8234d88b55a268d5c /bindings/python
parentf599ea7877e6e4fb92bae38d16453d6268dd955b (diff)
python: support relative path in default database
From notmuch 0.28, notmuch support relative database path in notmuch-config(1), but python binding haven't taught this yet. afew denied to work with a perfectly fine notmuch-config due to this.
Diffstat (limited to 'bindings/python')
-rw-r--r--bindings/python/notmuch/database.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
index 342d665a..88ca836e 100644
--- a/bindings/python/notmuch/database.py
+++ b/bindings/python/notmuch/database.py
@@ -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