unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] python: support relative path in default database
@ 2019-04-19  3:56 Doan Tran Cong Danh
  2019-04-20 12:41 ` David Edmondson
  2019-04-24 10:14 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Doan Tran Cong Danh @ 2019-04-19  3:56 UTC (permalink / raw)
  To: notmuch; +Cc: Doan Tran Cong Danh

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.
---
 bindings/python/notmuch/database.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] python: support relative path in default database
  2019-04-19  3:56 [PATCH] python: support relative path in default database Doan Tran Cong Danh
@ 2019-04-20 12:41 ` David Edmondson
  2019-04-24 10:14 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Edmondson @ 2019-04-20 12:41 UTC (permalink / raw)
  To: Doan Tran Cong Danh, notmuch; +Cc: Doan Tran Cong Danh

Looks good. Sorry for missing this.

On Friday, 2019-04-19 at 10:56:59 +07, Doan Tran Cong Danh wrote:

> 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.
> ---
>  bindings/python/notmuch/database.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> 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
> -- 
> 2.21.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

dme.
-- 
But are you safe Miss Gradenko?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] python: support relative path in default database
  2019-04-19  3:56 [PATCH] python: support relative path in default database Doan Tran Cong Danh
  2019-04-20 12:41 ` David Edmondson
@ 2019-04-24 10:14 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2019-04-24 10:14 UTC (permalink / raw)
  To: Doan Tran Cong Danh, notmuch; +Cc: Doan Tran Cong Danh

Doan Tran Cong Danh <congdanhqx@gmail.com> writes:

> 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.

pushed to  master

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-24 10:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-19  3:56 [PATCH] python: support relative path in default database Doan Tran Cong Danh
2019-04-20 12:41 ` David Edmondson
2019-04-24 10:14 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).