diff options
| author | J08nY | 2017-08-01 00:55:11 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-01 00:55:11 +0200 |
| commit | 89e7005f70a7feda03f15cbe39bf866a6f5bd059 (patch) | |
| tree | a5d61f909810688d32fda0ba10ce422eccbb5be5 /src/mailman_pgp/config/converter.py | |
| parent | cce2409e111c4b29bb8739c0699885007e7b81a2 (diff) | |
| download | mailman-pgp-89e7005f70a7feda03f15cbe39bf866a6f5bd059.tar.gz mailman-pgp-89e7005f70a7feda03f15cbe39bf866a6f5bd059.tar.zst mailman-pgp-89e7005f70a7feda03f15cbe39bf866a6f5bd059.zip | |
Diffstat (limited to 'src/mailman_pgp/config/converter.py')
| -rw-r--r-- | src/mailman_pgp/config/converter.py | 13 |
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 |
