Python: add/remove todos

This commit is contained in:
Romain Bazile 2020-10-21 21:24:29 +02:00
parent 06d9facb3d
commit 1530c71fb0
3 changed files with 5 additions and 5 deletions

View file

@ -99,6 +99,7 @@ class StreamingHandler(http.server.BaseHTTPRequestHandler):
output.condition.wait()
frame = output.frame
self.wfile.write(b"--FRAME\r\n")
# TODO exception BrokenPipeError here
self.send_header("Content-Type", "image/jpeg")
self.send_header("Content-Length", len(frame))
self.end_headers()
@ -158,10 +159,6 @@ class ImagerProcess(multiprocessing.Process):
self.__export_path = ""
self.__global_metadata = None
# TODO implement a way to receive directly the metadata from Node-Red via MQTT
# FIXME We should save the metadata to a file in the folder too
# TODO create a directory structure per day/per imaging session
logger.success("planktoscope.imager is initialised and ready to go!")
@logger.catch

View file

@ -87,6 +87,8 @@ class MQTT_Client:
@logger.catch
def connect(self):
logger.info(f"trying to connect to {self.server}:{self.port}")
# TODO add try: except ConnectionRefusedError: block here
# This is a symptom that Mosquitto may have failed to start
self.client.connect(self.server, self.port, 60)
self.client.on_connect = self.on_connect
self.client.on_subscribe = self.on_subscribe
@ -122,6 +124,7 @@ class MQTT_Client:
# Run this function in order to subscribe to all the topics begining by actuator
def on_subscribe(self, client, obj, mid, granted_qos):
# Print when subscribed
# TODO Fix bug when this is called outside of this init function (for example when the imager subscribe to status/pump)
logger.success(
f"{self.name} subscribed to {self.topic}! - mid:{str(mid)} qos:{str(granted_qos)}"
)