redhawk
redhawk copied to clipboard
ossie/utils/bluefile/bluefile_helpers.py: hdr_to_sri does not handle dict() extended header
REDHAWK 2.2.6
The way the method is written, the extended header (ext_header
) must be of list format. In the iteration over a dictionary, the value
is unused and item
is not in scope (this is a copy-paste error where the code for processing a list was almost used directly for the dict. The block of code can be fixed by replacing item[1]
with value
:
if isinstance(ext_hdr, dict):
for key, value in ext_hdr.iteritems():
try:
data=value
if isinstance(value, numpy.generic):
data=value.item()
dt = CF.DataType(key, ossie.properties.numpy_to_tc_value(data, type(value).__name__))
#print "DEBUG (dict) AFTER dt.value:", dt.value, dt.value.value(), type(dt.value.value())
kwds.append(dt)
except:
continue