'''Parse configuration value of the uri option of the rss section'''
rssuri=''
feedname=''
nopatternurinoglobalpattern=False
section='rss'
ifconfig.has_section(section):
############
# uri option
############
ifnotfeedsandnotclioption:
confoption='uri'
ifconfig.has_option(section,confoption):
urifeed=config.get('rss','uri')
feedname=None
if'<'inurifeed:
matches=re.match('(.*) <(.*)>',urifeed)
ifnotmatches:
sys.exit('This uri to parse is not formatted correctly: {urifeed}'.format(urifeed))
feedname,finaluri=matches.groups()
rssuri=finaluri
else:
rssuri=config.get('rss','uri')
else:
sys.exit('{confoption} parameter in the [{section}] section of the configuration file is mandatory. Exiting.'.format(section=section,confoption=confoption))