changing hardcoded nested config include to use appendwith, but still not in a proper recursive function [TODO]

This commit is contained in:
Peter Molnar 2017-11-30 17:01:57 +00:00
parent 5d3c0b538b
commit 85d834469c

View file

@ -576,25 +576,20 @@ def __setup_sitevars():
for o in config.options(section):
SiteVars.update({o: config.get(section, o)})
# add site author
section = 'author'
# TODO this should be a nice recursive function instead
# extra site section
for section in config.get('site', 'appendwith').split():
SiteVars.update({section: {}})
for o in config.options(section):
SiteVars[section].update({o: config.get(section, o)})
# add extra sections to author
for sub in config.get('author', 'appendwith').split():
if not config.get(section, 'appendwith', fallback=False):
continue
# subsections
for sub in config.get(section, 'appendwith').split():
SiteVars[section].update({sub: {}})
for o in config.options(sub):
SiteVars[section][sub].update({o: config.get(sub, o)})
# add payment
section = 'payment'
SiteVars.update({section: {}})
for o in config.options(section):
SiteVars[section].update({o: config.get(section, o)})
# push the whole thing into cache
return SiteVars
@ -620,7 +615,8 @@ def notify(msg):
ARROWFORMAT = {
'iso': 'YYYY-MM-DDTHH:mm:ssZ',
'display': 'YYYY-MM-DD HH:mm',
'rcf': 'ddd, DD MMM YYYY HH:mm:ss Z'
'rcf': 'ddd, DD MMM YYYY HH:mm:ss Z',
'twitter': 'ddd MMM DD HH:mm:ss Z YYYY'
}
LLEVEL = {