MCPcopy
hub / github.com/deadc0de6/dotdrop / _get_entry

Method _get_entry

dotdrop/cfg_yaml.py:1729–1740  ·  view source on GitHub ↗

return copy of entry from yaml dictionary

(cls, dic, key, mandatory=True)

Source from the content-addressed store, hash-verified

1727
1728 @classmethod
1729 def _get_entry(cls, dic, key, mandatory=True):
1730 """return copy of entry from yaml dictionary"""
1731 if key not in dic:
1732 if mandatory:
1733 err = f'invalid config: no entry \"{key}\" found'
1734 raise YamlException(err)
1735 dic[key] = {}
1736 return deepcopy(dic[key])
1737 if mandatory and not dic[key]:
1738 # ensure is not none
1739 dic[key] = {}
1740 return deepcopy(dic[key])
1741
1742 def _clear_none(self, dic):
1743 """recursively delete all none/empty values in a dictionary."""

Callers 10

_parse_blk_settingsMethod · 0.95
_parse_blk_dotfilesMethod · 0.95
_parse_blk_profilesMethod · 0.95
_parse_blk_actionsMethod · 0.95
_parse_blk_variablesMethod · 0.95
_import_subMethod · 0.95

Calls 1

YamlExceptionClass · 0.90

Tested by

no test coverage detected