removed M_POP_KEY variable

This commit is contained in:
iLLiCiTiT 2021-02-09 10:44:25 +01:00
parent ff0c168715
commit a04014d1f4
2 changed files with 2 additions and 10 deletions

View file

@ -4,14 +4,11 @@ M_OVERRIDEN_KEY = "__overriden_keys__"
M_ENVIRONMENT_KEY = "__environment_keys__" M_ENVIRONMENT_KEY = "__environment_keys__"
# Metadata key for storing dynamic created labels # Metadata key for storing dynamic created labels
M_DYNAMIC_KEY_LABEL = "__dynamic_keys_labels__" M_DYNAMIC_KEY_LABEL = "__dynamic_keys_labels__"
# NOTE key popping not implemented yet
M_POP_KEY = "__pop_key__"
METADATA_KEYS = ( METADATA_KEYS = (
M_OVERRIDEN_KEY, M_OVERRIDEN_KEY,
M_ENVIRONMENT_KEY, M_ENVIRONMENT_KEY,
M_DYNAMIC_KEY_LABEL, M_DYNAMIC_KEY_LABEL
M_POP_KEY
) )
# File where studio's system overrides are stored # File where studio's system overrides are stored
@ -24,7 +21,6 @@ __all__ = (
"M_OVERRIDEN_KEY", "M_OVERRIDEN_KEY",
"M_ENVIRONMENT_KEY", "M_ENVIRONMENT_KEY",
"M_DYNAMIC_KEY_LABEL", "M_DYNAMIC_KEY_LABEL",
"M_POP_KEY",
"METADATA_KEYS", "METADATA_KEYS",

View file

@ -6,7 +6,6 @@ import copy
from .constants import ( from .constants import (
M_OVERRIDEN_KEY, M_OVERRIDEN_KEY,
M_ENVIRONMENT_KEY, M_ENVIRONMENT_KEY,
M_POP_KEY,
METADATA_KEYS, METADATA_KEYS,
@ -292,10 +291,7 @@ def merge_overrides(source_dict, override_dict):
overriden_keys = set() overriden_keys = set()
for key, value in override_dict.items(): for key, value in override_dict.items():
if value == M_POP_KEY: if (key in overriden_keys or key not in source_dict):
source_dict.pop(key)
elif (key in overriden_keys or key not in source_dict):
source_dict[key] = value source_dict[key] = value
elif isinstance(value, dict) and isinstance(source_dict[key], dict): elif isinstance(value, dict) and isinstance(source_dict[key], dict):