From 0afbefc962f6c580b21abcffbc0fe533900f399a Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sat, 7 Oct 2023 10:33:56 -0400 Subject: [PATCH] simplyprint: fix linter errors Signed-off-by: Eric Callahan --- moonraker/components/simplyprint.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/moonraker/components/simplyprint.py b/moonraker/components/simplyprint.py index 8585cc5..06f32e1 100644 --- a/moonraker/components/simplyprint.py +++ b/moonraker/components/simplyprint.py @@ -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")