From 1c6d83b667a24c550a8e67cd7b4161b363647c2a Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 6 Aug 2010 18:22:46 +0200 Subject: [PATCH] config: Allow specifying configuration values with no default. By specifying a default of None, a config value will have no default. We could just leave out the value alltogether, but this way even values without a default are "documented" (this will be extended later). --- src/lib/backupninja/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/backupninja/config.py b/src/lib/backupninja/config.py index 0720f0a..030fc57 100644 --- a/src/lib/backupninja/config.py +++ b/src/lib/backupninja/config.py @@ -89,4 +89,7 @@ def _set_default_config(parser, values): if not parser.has_section(section): parser.add_section(section) for option, value in options.items(): - parser.set(section, option, value) + # Interpret None as "no default", since ConfigParser doesn't + # like non-string values. + if not value is None: + parser.set(section, option, value) -- 2.30.2