forked from jasonweiyi/XAPI2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
29 lines (21 loc) · 658 Bytes
/
config.py
File metadata and controls
29 lines (21 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# https://stackoverflow.com/questions/38987/how-to-merge-two-python-dictionaries-in-a-single-
def deepupdate(original, update):
"""
Recursively update a dict.
Subdict's won't be overwritten but also updated.
"""
for key, value in original.items():
if key not in update:
update[key] = value
elif isinstance(value, dict):
deepupdate(value, update[key])
return update
import config_default
configs = config_default.configs
try:
import config_override
configs = deepupdate(configs, config_override.configs)
except ImportError:
pass