Otherwise it will always use the default config.
Also add section fallback code to get_message in case the
feed-specific section is not in the config file. This is useful for
testing, although in production every feed should have a section to
hold it's URL.
Signed-off-by: W. Trevor King <wking@tremily.us>
"""
if config is None:
config = _config.CONFIG
+ if section not in config.sections():
+ section = 'DEFAULT'
encodings = [
x.strip() for x in config.get(section, 'encodings').split(',')]
subject=subject,
body=content['value'],
content_type=content['type'].split('/', 1)[1],
- extra_headers=extra_headers)
+ extra_headers=extra_headers,
+ config=self.config,
+ section=self.section)
return (guid, id_, sender, message)
def _get_entry_id(self, entry):