From 453a2f72edcb59ac7021cc48ab702ca8348d55ed Mon Sep 17 00:00:00 2001 From: Thomas Goodwin Date: Mon, 13 Jul 2015 13:38:35 -0400 Subject: [PATCH 1/2] Fix for issue #2 The call to type(prop.queryValue()) will throw an exception if no default value was provided for simple "string" properties (since they're None). This tweak lets simples be detected appropriately and fall back to type(prop.queryValue()) otherwise. --- model/redhawk.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/model/redhawk.py b/model/redhawk.py index 81d7e96..a856e64 100644 --- a/model/redhawk.py +++ b/model/redhawk.py @@ -26,6 +26,8 @@ from _utils.tasking import background_task +from ossie.utils import prop_helper + from domain import Domain, scan_domains, ResourceNotFound @@ -106,7 +108,8 @@ def component_configure(self, domain_name, app_id, comp_id, new_properties): for prop in comp._properties: if prop.id in new_properties: if new_properties[prop.id] != prop.queryValue(): - configure_changes[prop.id] = (type(prop.queryValue()))(new_properties[prop.id]) + TYPE = prop_helpers.TYPE_MAP.get(prop.type, [type(prop.queryValue())]) + configure_changes[prop.id] = (TYPE[0])(new_properties[prop.id]) return comp.configure(configure_changes) From e1906439506b2443615b087133d42b913639bc75 Mon Sep 17 00:00:00 2001 From: Thomas Goodwin Date: Tue, 28 Jul 2015 14:29:04 -0400 Subject: [PATCH 2/2] Update redhawk.py Previous fix was for 1.8-series of the python interface. This change will work in the current revision. --- model/redhawk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/redhawk.py b/model/redhawk.py index a856e64..f799ccb 100644 --- a/model/redhawk.py +++ b/model/redhawk.py @@ -26,7 +26,7 @@ from _utils.tasking import background_task -from ossie.utils import prop_helper +from ossie.properties import __TYPE_MAP as TYPE_MAP from domain import Domain, scan_domains, ResourceNotFound @@ -108,7 +108,7 @@ def component_configure(self, domain_name, app_id, comp_id, new_properties): for prop in comp._properties: if prop.id in new_properties: if new_properties[prop.id] != prop.queryValue(): - TYPE = prop_helpers.TYPE_MAP.get(prop.type, [type(prop.queryValue())]) + TYPE = TYPE_MAP.get(prop.type, [type(prop.queryValue())]) configure_changes[prop.id] = (TYPE[0])(new_properties[prop.id]) return comp.configure(configure_changes)