Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

INCLUDES in multiple configuration are now cumulative

  • Loading branch information...
commit f1145121ff345399561b0fa1357393a0c870ad0e 1 parent 142da32
Yotam Rubin authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 dwight_chroot/config.py
View
10 dwight_chroot/config.py
@@ -49,6 +49,14 @@ def _ensure_user_config_file(self, user_config_file_path):
os.makedirs(os.path.dirname(user_config_file_path))
with open(user_config_file_path, "w") as user_config_file:
user_config_file.write(_USER_CONFIG_FILE_TEMPLATE)
+
+ def _update_config(self, config):
+ append_keys = ['INCLUDES']
+ appended_items = dict((append_key, config[append_key] + self._config[append_key])
+ for append_key in append_keys)
+
+ self._config.update(config)
+ self._config.update(appended_items)
def load_from_string(self, s):
d = copy.deepcopy(self._config)
try:
@@ -59,7 +67,7 @@ def load_from_string(self, s):
if key.startswith("_") or not key[0].isupper():
d.pop(key)
self._check_unknown_parameters(d)
- self._config.update(d)
+ self._update_config(d)
def _check_unknown_parameters(self, d):
unknown = set(d) - self._known_keys
if unknown:
Please sign in to comment.
Something went wrong with that request. Please try again.