Commit e664f34a by Oleksandr Barabash

file write fixed

parent 59a37d5b
......@@ -58,7 +58,6 @@ class CSVLogger(PacketLogger):
"DoA", "Confidence", "Power", "Serial",
"Radio Bearing",
"Compass Offset"]) + self.BREAK_LINE)
self.file.save()
@staticmethod
def serialize_data(data: Any) -> str:
......@@ -72,7 +71,12 @@ class CSVLogger(PacketLogger):
""" Try write """
if self.file is None:
self.file = open(self.file_path, "a+")
for _ in range(50):
try:
self.file.write(data)
break
except IOError:
pass
self.records += 1
if self.records % 50 == 0:
......
Markdown is supported
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