MCPcopy Create free account
hub / github.com/FullControlXYZ/fullcontrol / update_from

Method update_from

fullcontrol/base.py:35–48  ·  view source on GitHub ↗

Updates the attributes of the current object from the attributes of another object. Args: source: The object from which to update the attributes. Returns: None

(self, source)

Source from the content-addressed store, hash-verified

33 def __getitem__(self, name): return getattr(self, name)
34
35 def update_from(self, source):
36 """
37 Updates the attributes of the current object from the attributes of another object.
38
39 Args:
40 source: The object from which to update the attributes.
41
42 Returns:
43 None
44 """
45 self_vars = vars(self) # cache, for multiple checks
46 for key, value in vars(source).items():
47 if (value is not None) and (key in self_vars):
48 self[key] = value
49
50 if int(__version__.split('.')[0]) >= 2:
51 # Pydantic v2 config

Callers 15

xyz_add_bcFunction · 0.80
xyz_add_bFunction · 0.80
xyz_add_bcFunction · 0.80
inverse_kinematicsMethod · 0.80
gcodeMethod · 0.80
gcodeMethod · 0.80
inverse_kinematicsMethod · 0.80
gcodeMethod · 0.80
gcodeMethod · 0.80
inverse_kinematicsMethod · 0.80
gcodeMethod · 0.80
gcodeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected