fallback to build in defaults
This commit is contained in:
parent
3659b64cce
commit
88e1cf8837
1 changed files with 9 additions and 3 deletions
|
|
@ -811,6 +811,12 @@ 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)
|
||||||
|
else:
|
||||||
|
print("no defaults defined at %s" % path)
|
||||||
|
defaults = {
|
||||||
|
"lang": "en",
|
||||||
|
"censored": None
|
||||||
|
}
|
||||||
for key in defaults:
|
for key in defaults:
|
||||||
if key not in options:
|
if key not in options:
|
||||||
options[key] = defaults[key]
|
options[key] = defaults[key]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue