Commit cd51a93d authored by Reto Da Forno's avatar Reto Da Forno
Browse files

string instead of bytestring

parent 3b7cdd96
......@@ -136,16 +136,20 @@ def parse_error_log(buf):
#
##############################################################################
def convert_gpio_setting(obsdata, observer_id, node_id):
return "%s,%s,%s,%s,%s,%s\n" %(obsdata[2], obsdata[3], observer_id, node_id, pindict[obsdata[0]][0], obsdata[1])
return "%s,%s,%s,%s,%s,%s\n" % (obsdata[2], obsdata[3], observer_id, node_id, pindict[obsdata[0]][0], obsdata[1])
def convert_gpio_monitor(obsdata, observer_id, node_id):
return "%s,%s,%s,%s,%s\n" %(obsdata[1], observer_id, node_id, obsdata[0], obsdata[2])
return "%s,%s,%s,%s,%s\n" % (obsdata[1], observer_id, node_id, obsdata[0], obsdata[2])
def convert_serial(obsdata, observer_id, node_id):
return "%s,%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, serialdict[obsdata[0]], obsdata[1])
try:
result = "%s,%s,%s,%s,%s\n" % (obsdata[2], observer_id, node_id, serialdict[obsdata[0]], obsdata[1].decode('utf8'))
except UnicodeDecodeError:
result = "%s,%s,%s,%s,%s\n" % (obsdata[2], observer_id, node_id, serialdict[obsdata[0]], str(obsdata[1]))
return result
def convert_error_log(obsdata, observer_id, node_id):
return "%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, obsdata[1])
return "%s,%s,%s,%s\n" % (obsdata[2], observer_id, node_id, obsdata[1])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment