aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/config/converter.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/config/converter.py')
-rw-r--r--src/mailman_pgp/config/converter.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mailman_pgp/config/converter.py b/src/mailman_pgp/config/converter.py
index ac2cf22..e3cdb90 100644
--- a/src/mailman_pgp/config/converter.py
+++ b/src/mailman_pgp/config/converter.py
@@ -40,12 +40,13 @@ class ConfigConverter:
for section in self.schema.sections():
out[section] = dict()
for option in self.schema.options(section):
- out[section][option] = self._transform_option(
- cfg.get(section, option),
- self.schema.get(section, option))
+ out[section][option] = self._transform_option(section, option,
+ cfg.get(section,
+ option))
return out
- def _transform_option(self, value, schema):
+ def converter(self, section, option):
+ schema = self.schema.get(section, option)
call = None
try:
call = getattr(builtins, schema)
@@ -59,6 +60,10 @@ class ConfigConverter:
if match is None:
raise ValueError
return match.group()
+ return call
+
+ def _transform_option(self, section, option, value):
+ call = self.converter(section, option)
if call is None:
raise ValueError