You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now config file is hardcoded to be $XDG_CONFIG(~/.config if not defined)/afew/config. In usecases concerning multiple notmuch dbs this is preventing to have separate configuration per db.
I've solved it with following quick and dirty solution introducing AFEW_CONFIG environment variable:
diff --git a/afew/Settings.py b/afew/Settings.py
index 44d6f3c..b37154e 100644
--- a/afew/Settings.py+++ b/afew/Settings.py@@ -19,7 +19,7 @@ settings = ConfigParser()
settings.optionxform = str
settings.readfp(open(os.path.join(os.path.dirname(__file__), 'defaults', 'afew.config')))
-settings.read(os.path.join(user_config_dir, 'config'))+settings.read(os.environ.get('AFEW_CONFIG', os.path.join(user_config_dir, 'config')))
# All the values for keys listed here are interpreted as ;-delimited lists
value_is_a_list = ['tags', 'tags_blacklist']
I guess it would be nicer if there were also accompanying argparse() parameter (probably -c). I haven't got around to do it myself mainly because it would need refactoring of Settings.py code which does parsing of settings on import.
If above is acceptable for now let me know and I'll make it as PR, probably mentioning it in man page would be good too.
The text was updated successfully, but these errors were encountered:
There is #307 hanging for a year now, any update or possibility to merge that? I don't see why it has no reply yet all other open PRs have some sort of review.
Right now config file is hardcoded to be
$XDG_CONFIG(~/.config if not defined)/afew/config
. In usecases concerning multiple notmuch dbs this is preventing to have separate configuration per db.I've solved it with following quick and dirty solution introducing
AFEW_CONFIG
environment variable:I guess it would be nicer if there were also accompanying
argparse()
parameter (probably-c
). I haven't got around to do it myself mainly because it would need refactoring ofSettings.py
code which does parsing of settings on import.If above is acceptable for now let me know and I'll make it as PR, probably mentioning it in man page would be good too.
The text was updated successfully, but these errors were encountered: