Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if value.lower() == 'true':
custom_properties[name] = True
elif value.lower() == 'false':
custom_properties[name] = False
# int('3.1') doesn't work so need to get float('3.14') first
elif str(int(float(value))) == value:
custom_properties[name] = int(value)
else:
custom_properties[name] = float(value)
if message_type == None:
message = Message(
respbody, service_instance, message_location, custom_properties,
'application/atom+xml;type=entry;charset=utf-8', broker_properties)
else:
message = Message(respbody, service_instance, message_location,
custom_properties, message_type, broker_properties)
return message
value, '%a, %d %b %Y %H:%M:%S GMT')
except ValueError:
custom_properties[name] = value
else: # only int, float or boolean
if value.lower() == 'true':
custom_properties[name] = True
elif value.lower() == 'false':
custom_properties[name] = False
# int('3.1') doesn't work so need to get float('3.14') first
elif str(int(float(value))) == value:
custom_properties[name] = int(value)
else:
custom_properties[name] = float(value)
if message_type == None:
message = Message(
respbody, service_instance, message_location, custom_properties,
'application/atom+xml;type=entry;charset=utf-8', broker_properties)
else:
message = Message(respbody, service_instance, message_location,
custom_properties, message_type, broker_properties)
return message