Adding checking for COLORCODE UTF-8

This commit is contained in:
Waldek
2021-03-29 19:22:31 +02:00
committed by GitHub
parent e6c9b2175e
commit 907df948f3
+8 -2
View File
@@ -272,12 +272,18 @@ def add_hb_peer(_peer_conf, _ctable_loc, _peer):
_ctable_peer['CALLSIGN'] = _peer_conf['CALLSIGN'].decode('utf-8').strip()
else:
_ctable_peer['CALLSIGN'] = _peer_conf['CALLSIGN']
_ctable_peer['COLORCODE'] = _peer_conf['COLORCODE'].decode('utf-8')
if str(type(_peer_conf['COLORCODE'])).find("bytes") != -1:
_ctable_peer['COLORCODE'] = _peer_conf['COLORCODE'].decode('utf-8').strip()
else:
_ctable_peer['COLORCODE'] = _peer_conf['COLORCODE']
_ctable_peer['CONNECTION'] = _peer_conf['CONNECTION']
_ctable_peer['CONNECTED'] = since(_peer_conf['CONNECTED'])
_ctable_peer['IP'] = _peer_conf['IP']
_ctable_peer['PORT'] = _peer_conf['PORT']
#_ctable_peer['LAST_PING'] = _peer_conf['LAST_PING']
# SLOT 1&2 - for real-time montior: make the structure for later use