From e7a289c82993d1650adb69963ece8b21532ad6f3 Mon Sep 17 00:00:00 2001 From: Bohdan V <25197509+BohdanVV@users.noreply.github.com> Date: Mon, 3 Mar 2025 15:24:49 +0100 Subject: [PATCH] fix(examples): correct `get_human_readable()` to return proper example data --- .../example_utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py index 548c9fce1..8bb89ce5a 100644 --- a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py +++ b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/example_utils.py @@ -73,13 +73,13 @@ def set_data_file_in_config(config, file): @staticmethod def get_human_readable(device, property): try: - value = getattr(device, property) - if value.has_value(): - return value.value() - else: - return f"Unknown ({value.no_value_message()})" - except: + value = device.get(property) + except Exception: return "Property not found in data file" + if value and value.has_value(): + return value.value() + else: + return f"Unknown ({value.no_value_message()})" @staticmethod def get_resource_key():