Skip to content

Commit

Permalink
Fix get_attr_4u when using inherited class such the camera simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebionne committed Mar 15, 2024
1 parent 6a5f3c8 commit 9e72d66
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Lima/Server/AttrHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ def get_attr_4u(obj, name, interface, update_dict=True):
if name.startswith("read_") or name.startswith("write_"):
split_name = name.split("_")[1:]
attr_name = "".join([x.title() for x in split_name])
dict_name = "_" + obj.__class__.__name__ + "__" + attr_name
d = getattr(obj, dict_name, None)
# Look for a public attribute first (available in inherited classes)
d = getattr(obj, "_" + attr_name, None)
if d is None:
dict_name = "_" + obj.__class__.__name__ + "__" + attr_name
d = getattr(obj, dict_name, None)
dict_name = "_" + obj.__class__.__name__ + "__Attribute2FunctionBase"
dict_name = getattr(obj, dict_name, None)
if dict_name:
Expand Down

0 comments on commit 9e72d66

Please sign in to comment.