From 2a1358f64a239e99c7a2c622a9145613e8ddbb90 Mon Sep 17 00:00:00 2001 From: Jon Crall Date: Tue, 19 Nov 2024 07:48:32 -0500 Subject: [PATCH] Minor linting (#142) * Minor linting * Update service.py * Update service.py --------- Co-authored-by: JarbasAI <33701864+JarbasAl@users.noreply.github.com> --- ovos_dinkum_listener/service.py | 13 ++++++------- ovos_dinkum_listener/transformers.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ovos_dinkum_listener/service.py b/ovos_dinkum_listener/service.py index 1388c28..80c4216 100644 --- a/ovos_dinkum_listener/service.py +++ b/ovos_dinkum_listener/service.py @@ -808,7 +808,7 @@ def _handle_listen(self, message: Message): dur = get_sound_duration(sound) LOG.debug(f"{sound} duration: {dur} seconds") self.voice_loop.confirmation_seconds_left = dur - except: + except Exception: self.voice_loop.confirmation_seconds_left = self.voice_loop.confirmation_seconds else: self.voice_loop.state = ListeningState.BEFORE_COMMAND @@ -1068,7 +1068,7 @@ def reload_configuration(self): self.status.set_alive() if not self.disable_reload and new_hash['stt'] != self._applied_config_hash['stt']: - LOG.info(f"Reloading STT") + LOG.info("Reloading STT") if self.stt: LOG.debug(f"old={self.stt.__class__}: {self.stt.config}") if hasattr(self.stt, "shutdown"): @@ -1079,9 +1079,8 @@ def reload_configuration(self): if self.stt: LOG.debug(f"new={self.stt.__class__}: {self.stt.config}") - if not self.disable_reload and not self.disable_fallback and new_hash['fallback'] != \ - self._applied_config_hash['fallback']: - LOG.info(f"Reloading Fallback STT") + if not self.disable_reload and not self.disable_fallback and new_hash['fallback'] != self._applied_config_hash['fallback']: + LOG.info("Reloading Fallback STT") if self.fallback_stt: LOG.debug(f"old={self.fallback_stt.__class__}: " f"{self.fallback_stt.config}") @@ -1095,7 +1094,7 @@ def reload_configuration(self): f"{self.fallback_stt.config}") if not self.disable_hotword_reload and new_hash['hotwords'] != self._applied_config_hash['hotwords']: - LOG.info(f"Reloading Hotwords") + LOG.info("Reloading Hotwords") LOG.debug(f"old={self.hotwords.applied_hotwords_config}") self._reload_event.clear() self.voice_loop.stop() @@ -1104,7 +1103,7 @@ def reload_configuration(self): LOG.debug(f"new={self.hotwords.applied_hotwords_config}") if new_hash['loop'] != self._applied_config_hash['loop']: - LOG.info(f"Reloading Listener") + LOG.info("Reloading Listener") self._reload_event.clear() self.voice_loop.stop() diff --git a/ovos_dinkum_listener/transformers.py b/ovos_dinkum_listener/transformers.py index f1ba959..dd0de37 100644 --- a/ovos_dinkum_listener/transformers.py +++ b/ovos_dinkum_listener/transformers.py @@ -53,7 +53,7 @@ def load_plugins(self): self.loaded_plugins[plug_name] = plug() self.loaded_plugins[plug_name].bind(self.bus) LOG.info(f"loaded audio transformer plugin: {plug_name}") - except Exception as e: + except Exception: LOG.exception(f"Failed to load audio transformer plugin: " f"{plug_name}") self.has_loaded = True