mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-20 08:20:02 +02:00
replaces some code with helper function
This commit is contained in:
parent
5f78771f66
commit
e69ef376ae
@ -15,6 +15,7 @@ from pydase.utils.helpers import (
|
|||||||
get_attribute_doc,
|
get_attribute_doc,
|
||||||
get_component_classes,
|
get_component_classes,
|
||||||
get_data_service_class_reference,
|
get_data_service_class_reference,
|
||||||
|
is_property_attribute,
|
||||||
parse_full_access_path,
|
parse_full_access_path,
|
||||||
parse_serialized_key,
|
parse_serialized_key,
|
||||||
)
|
)
|
||||||
@ -316,7 +317,7 @@ class Serializer:
|
|||||||
value[key] = serialized_object
|
value[key] = serialized_object
|
||||||
|
|
||||||
# If the DataService attribute is a property
|
# If the DataService attribute is a property
|
||||||
if isinstance(getattr(obj.__class__, key, None), property):
|
if is_property_attribute(obj, key):
|
||||||
prop: property = getattr(obj.__class__, key)
|
prop: property = getattr(obj.__class__, key)
|
||||||
value[key]["readonly"] = prop.fset is None
|
value[key]["readonly"] = prop.fset is None
|
||||||
value[key]["doc"] = get_attribute_doc(prop) # overwrite the doc
|
value[key]["doc"] = get_attribute_doc(prop) # overwrite the doc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user