simplyprint: fix linter errors

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-10-07 10:33:56 -04:00
parent a28c7c3f93
commit 0afbefc962
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 6 additions and 7 deletions

View File

@ -222,8 +222,7 @@ class SimplyPrint(Subscribable):
timediff = curtime - self.last_err_log_time
if timediff > CONNECTION_ERROR_LOG_TIME:
self.last_err_log_time = curtime
logging.exception(
f"Failed to connect to SimplyPrint")
logging.exception("Failed to connect to SimplyPrint")
else:
logging.info("Connected to SimplyPrint Cloud")
await self._read_messages()
@ -306,7 +305,7 @@ class SimplyPrint(Subscribable):
logging.debug(f"Invalid token received: {token}")
token = None
else:
logging.info(f"SimplyPrint Token Received")
logging.info("SimplyPrint Token Received")
self.save_item("printer_token", token)
self._set_ws_url()
if "short_id" in data:
@ -323,14 +322,14 @@ class SimplyPrint(Subscribable):
return
printer_id = data.get("printer_id")
if printer_id is None:
logging.debug(f"Invalid printer id, received null (None) value")
logging.debug("Invalid printer id, received null (None) value")
self.save_item("printer_id", str(printer_id))
self._set_ws_url()
self.save_item("temp_short_setup_id", None)
self.eventloop.create_task(self._remove_setup_announcement())
elif event == "demand":
if data is None:
logging.debug(f"Invalid message, no data")
logging.debug("Invalid message, no data")
return
demand = data.pop("demand", "unknown")
self._process_demand(demand, data)
@ -369,7 +368,7 @@ class SimplyPrint(Subscribable):
elif demand == "file":
url: Optional[str] = args.get("url")
if not isinstance(url, str):
logging.debug(f"Invalid url in message")
logging.debug("Invalid url in message")
return
start = bool(args.get("auto_start", 0))
self.print_handler.download_file(url, start)
@ -1399,7 +1398,7 @@ class WebcamStream:
self.simplyprint.send_sp("stream", {"base": img})
except asyncio.CancelledError:
raise
except Exception as e:
except Exception:
if not self.server.is_verbose_enabled():
return
logging.exception("SimplyPrint WebCam Stream Error")