fallback to build in defaults
This commit is contained in:
parent
3659b64cce
commit
88e1cf8837
1 changed files with 9 additions and 3 deletions
12
render.py
12
render.py
|
|
@ -811,9 +811,15 @@ def load_defaults(options):
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
with open(path) as fd:
|
with open(path) as fd:
|
||||||
defaults = json.load(fd)
|
defaults = json.load(fd)
|
||||||
for key in defaults:
|
else:
|
||||||
if key not in options:
|
print("no defaults defined at %s" % path)
|
||||||
options[key] = defaults[key]
|
defaults = {
|
||||||
|
"lang": "en",
|
||||||
|
"censored": None
|
||||||
|
}
|
||||||
|
for key in defaults:
|
||||||
|
if key not in options:
|
||||||
|
options[key] = defaults[key]
|
||||||
return options
|
return options
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue