changing hardcoded nested config include to use appendwith, but still not in a proper recursive function [TODO]
This commit is contained in:
parent
5d3c0b538b
commit
85d834469c
1 changed files with 15 additions and 19 deletions
34
shared.py
34
shared.py
|
@ -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
|
||||||
SiteVars.update({section: {}})
|
for section in config.get('site', 'appendwith').split():
|
||||||
for o in config.options(section):
|
SiteVars.update({section: {}})
|
||||||
SiteVars[section].update({o: config.get(section, o)})
|
for o in config.options(section):
|
||||||
|
SiteVars[section].update({o: config.get(section, o)})
|
||||||
|
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 extra sections to author
|
|
||||||
for sub in config.get('author', '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
|
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 = {
|
||||||
|
|
Loading…
Reference in a new issue