summaryrefslogtreecommitdiffstats
path: root/pinolo/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'pinolo/config.py')
-rw-r--r--pinolo/config.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/pinolo/config.py b/pinolo/config.py
index fc2f316..6801a2d 100644
--- a/pinolo/config.py
+++ b/pinolo/config.py
@@ -25,8 +25,15 @@ def read_config_file(filename):
if config.get("@root.datadir") is None:
fatal("Config error: empty 'datadir' parameter")
- else:
- if config["datadir"].startswith("~"):
- config.set("datadir", os.path.expanduser(config["datadir"]))
+
+ to_expand = ("@root.datadir", "@root.plugins.quotes2.db_path",
+ "@root.plugins.markov.db_file")
+ for name in to_expand:
+ path = config.get(name)
+ if path is not None and path.startswith("~"):
+ config.set(name, os.path.expanduser(path))
return config
+
+def empty_config(root, name):
+ return coil.struct.Struct(container=root["plugins"], name=name)