Skip to content

Conversation

paretje
Copy link
Contributor

@paretje paretje commented Jan 20, 2019

Notmuch cli uses the MAILDIR environment variable as a default when no database path is configured in notmuch config. This adds the same behaviour to afew.

       database.path
              The top-level directory where your mail currently exists and to where mail will be delivered in the future. Files
              should be individual email messages. Notmuch will store its database within a sub-directory of the  path  config‐
              ured here named .notmuch.

              Default: $MAILDIR variable if set, otherwise $HOME/mail.

afew/Database.py Outdated
self.db_path = notmuch_settings.get('database', 'path')
self.db_path = notmuch_settings.get('database', 'path',
fallback=os.environ.get('MAILDIR',
'%s/mail' % os.environ.get('HOME')))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use PyFormat here?

@flokli
Copy link
Member

flokli commented Jan 20, 2019

I'm wondering, can we avoid reading notmuch settings on our own completely?

@paretje
Copy link
Contributor Author

paretje commented Feb 1, 2019

I checked, and notmuch_config_open isn't exposed in libnotmuch. So unless we would use something like notmuch config get database.path, I don't think we can get rid of this. E.g. alot also reads the config file on its own.

@flokli
Copy link
Member

flokli commented Mar 16, 2019

@paretje then fine for me - could you rebase this on master?

In addition, it would be nice if you could add a line to docs/configuration.rst mentioning that afew honors the MAILDIR environment variable as fallback, like notmuch does too.

@paretje
Copy link
Contributor Author

paretje commented Mar 22, 2019

@flokli I just documented how afew determines the notmuch database location.

@flokli flokli merged commit 3bb53db into afewmail:master Mar 26, 2019
@flokli
Copy link
Member

flokli commented Mar 26, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants