MCPcopy Index your code
hub / github.com/pyinvoke/invoke / _path_set

Method _path_set

invoke/env.py:99–109  ·  view source on GitHub ↗
(self, key_path: Sequence[str], value: str)

Source from the content-addressed store, hash-verified

97 return obj
98
99 def _path_set(self, key_path: Sequence[str], value: str) -> None:
100 # Sets are to self.data since that's what we are presenting to the
101 # outer config object and debugging.
102 obj = self.data
103 for key in key_path[:-1]:
104 if key not in obj:
105 obj[key] = {}
106 obj = obj[key]
107 old = self._path_get(key_path)
108 new = self._cast(old, value)
109 obj[key_path[-1]] = new
110
111 def _cast(self, old: Any, new: Any) -> Any:
112 if isinstance(old, bool):

Callers 1

loadMethod · 0.95

Calls 2

_path_getMethod · 0.95
_castMethod · 0.95

Tested by

no test coverage detected