pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
681 stars 162 forks source link

alot/settings: Use notmuch config to read configuration #1615

Closed guludo closed 1 year ago

guludo commented 1 year ago

The main benefit from this is that we get the defaults directly from notmuch and do not risk using inconsistent configuration values.

A good example of this is getting the database path. Getting the path directly from the notmuch config file is not enough, because the user might be using the default location with no explicit entry in the file. Since notmuch does is a bit of logic notmuch to get the database path (see section "DATABASE LOCATION" in man page for notmuch-config(1)), it is better to get it directly from "notmuch config".

Since get_notmuch_setting() now always returns a string, also refactor the call to settings.get_notmuch_setting('maildir', 'synchronize_flags') for this new reality.

guludo commented 1 year ago

This PR partially addresses https://github.com/pazz/alot/pull/1610#issuecomment-1506483026

pazz commented 1 year ago

Looks good. thank you. I should really fix this travis CI thing, or better replace it by GitHub actions..

lucc commented 11 months ago

The change in e500326 broke the test test_parsing_notmuch_config_with_non_bool_synchronize_flag_fails.