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): for o in config.options(section):
SiteVars.update({o: config.get(section, o)}) SiteVars.update({o: config.get(section, o)})
# add site author # TODO this should be a nice recursive function instead
section = 'author' # extra site section
for section in config.get('site', 'appendwith').split():
SiteVars.update({section: {}}) SiteVars.update({section: {}})
for o in config.options(section): for o in config.options(section):
SiteVars[section].update({o: config.get(section, o)}) SiteVars[section].update({o: config.get(section, o)})
if not config.get(section, 'appendwith', fallback=False):
# add extra sections to author continue
for sub in config.get('author', 'appendwith').split(): # subsections
for sub in config.get(section, 'appendwith').split():
SiteVars[section].update({sub: {}}) SiteVars[section].update({sub: {}})
for o in config.options(sub): for o in config.options(sub):
SiteVars[section][sub].update({o: config.get(sub, o)}) 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 return SiteVars
@ -620,7 +615,8 @@ def notify(msg):
ARROWFORMAT = { ARROWFORMAT = {
'iso': 'YYYY-MM-DDTHH:mm:ssZ', 'iso': 'YYYY-MM-DDTHH:mm:ssZ',
'display': 'YYYY-MM-DD HH:mm', '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 = { LLEVEL = {