mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-22 09:10:01 +02:00
renames helper function
This commit is contained in:
parent
27bb73a2da
commit
8dd05ac5e3
@ -13,7 +13,7 @@ from pydase.data_service.task_manager import TaskManager
|
|||||||
from pydase.utils.helpers import (
|
from pydase.utils.helpers import (
|
||||||
convert_arguments_to_hinted_types,
|
convert_arguments_to_hinted_types,
|
||||||
get_class_and_instance_attributes,
|
get_class_and_instance_attributes,
|
||||||
get_object_attr_from_path,
|
get_object_attr_from_path_list,
|
||||||
is_property_attribute,
|
is_property_attribute,
|
||||||
parse_list_attr_and_index,
|
parse_list_attr_and_index,
|
||||||
update_value_if_changed,
|
update_value_if_changed,
|
||||||
@ -234,7 +234,7 @@ class DataService(rpyc.Service, AbstractDataService):
|
|||||||
# If attr_name corresponds to a list entry, extract the attr_name and the index
|
# If attr_name corresponds to a list entry, extract the attr_name and the index
|
||||||
attr_name, index = parse_list_attr_and_index(attr_name)
|
attr_name, index = parse_list_attr_and_index(attr_name)
|
||||||
# Traverse the object according to the path parts
|
# Traverse the object according to the path parts
|
||||||
target_obj = get_object_attr_from_path(self, path_list)
|
target_obj = get_object_attr_from_path_list(self, path_list)
|
||||||
|
|
||||||
# If the attribute is a property, change it using the setter without getting the
|
# If the attribute is a property, change it using the setter without getting the
|
||||||
# property value (would otherwise be bad for expensive getter methods)
|
# property value (would otherwise be bad for expensive getter methods)
|
||||||
@ -242,7 +242,7 @@ class DataService(rpyc.Service, AbstractDataService):
|
|||||||
setattr(target_obj, attr_name, value)
|
setattr(target_obj, attr_name, value)
|
||||||
return
|
return
|
||||||
|
|
||||||
attr = get_object_attr_from_path(target_obj, [attr_name])
|
attr = get_object_attr_from_path_list(target_obj, [attr_name])
|
||||||
if attr is None:
|
if attr is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import pydase.units as u
|
|||||||
from pydase.data_service.data_service import process_callable_attribute
|
from pydase.data_service.data_service import process_callable_attribute
|
||||||
from pydase.data_service.data_service_cache import DataServiceCache
|
from pydase.data_service.data_service_cache import DataServiceCache
|
||||||
from pydase.utils.helpers import (
|
from pydase.utils.helpers import (
|
||||||
get_object_attr_from_path,
|
get_object_attr_from_path_list,
|
||||||
is_property_attribute,
|
is_property_attribute,
|
||||||
parse_list_attr_and_index,
|
parse_list_attr_and_index,
|
||||||
)
|
)
|
||||||
@ -195,7 +195,7 @@ class StateManager:
|
|||||||
attr_name, index = parse_list_attr_and_index(attr_name)
|
attr_name, index = parse_list_attr_and_index(attr_name)
|
||||||
|
|
||||||
# Traverse the object according to the path parts
|
# Traverse the object according to the path parts
|
||||||
target_obj = get_object_attr_from_path(self.service, parent_path_list)
|
target_obj = get_object_attr_from_path_list(self.service, parent_path_list)
|
||||||
|
|
||||||
# If the attribute is a property, change it using the setter without getting
|
# If the attribute is a property, change it using the setter without getting
|
||||||
# the property value (would otherwise be bad for expensive getter methods)
|
# the property value (would otherwise be bad for expensive getter methods)
|
||||||
|
@ -31,7 +31,7 @@ def get_class_and_instance_attributes(obj: object) -> dict[str, Any]:
|
|||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
|
|
||||||
def get_object_attr_from_path(target_obj: Any, path: list[str]) -> Any:
|
def get_object_attr_from_path_list(target_obj: Any, path: list[str]) -> Any:
|
||||||
"""
|
"""
|
||||||
Traverse the object tree according to the given path.
|
Traverse the object tree according to the given path.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user