foo
This commit is contained in:
5
main.py
Normal file → Executable file
5
main.py
Normal file → Executable file
@@ -1,3 +1,4 @@
|
||||
|
||||
import config
|
||||
import subprocess
|
||||
import os
|
||||
@@ -94,6 +95,7 @@ class SerialWriter(threading.Thread):
|
||||
data = self.datasource.getData()
|
||||
ser.write(b"\01")
|
||||
ser.write(data)
|
||||
ser.flush()
|
||||
except Exception as e:
|
||||
if ser != None:
|
||||
ser.close()
|
||||
@@ -138,8 +140,9 @@ class LogReader(threading.Thread):
|
||||
logging.info("LogReader started")
|
||||
while running and self.running:
|
||||
try:
|
||||
self.log += runner.app.stderr.read(1).decode("utf-8")
|
||||
self.log += self.runner.app.stderr.read(1).decode("utf-8")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
time.sleep(1)
|
||||
logging.info("LogReader closed")
|
||||
def stop(self):
|
||||
|
Reference in New Issue
Block a user