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

Method _set

invoke/config.py:190–205  ·  view source on GitHub ↗

Convenience workaround of default 'attrs are config keys' behavior. Uses `object.__setattr__` to work around the class' normal proxying behavior, but is less verbose than using that directly. Has two modes (which may be combined if you really want): - ``se

(self, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

188 return value
189
190 def _set(self, *args: Any, **kwargs: Any) -> None:
191 """
192 Convenience workaround of default 'attrs are config keys' behavior.
193
194 Uses `object.__setattr__` to work around the class' normal proxying
195 behavior, but is less verbose than using that directly.
196
197 Has two modes (which may be combined if you really want):
198
199 - ``self._set('attrname', value)``, just like ``__setattr__``
200 - ``self._set(attname=value)`` (i.e. kwargs), even less typing.
201 """
202 if args:
203 object.__setattr__(self, *args)
204 for key, value in kwargs.items():
205 object.__setattr__(self, key, value)
206
207 def __repr__(self) -> str:
208 return "<{}: {}>".format(self.__class__.__name__, self._config)

Callers 14

__init__Method · 0.80
configMethod · 0.80
__init__Method · 0.80
from_dataMethod · 0.80
__init__Method · 0.80
load_defaultsMethod · 0.80
load_overridesMethod · 0.80
set_runtime_pathMethod · 0.80
load_shell_envMethod · 0.80
load_collectionMethod · 0.80
set_project_locationMethod · 0.80
_load_fileMethod · 0.80

Calls 1

__setattr__Method · 0.80

Tested by

no test coverage detected