Skip to content

Commit

Permalink
Minor linting (#142)
Browse files Browse the repository at this point in the history
* Minor linting

* Update service.py

* Update service.py

---------

Co-authored-by: JarbasAI <[email protected]>
  • Loading branch information
Erotemic and JarbasAl authored Nov 19, 2024
1 parent baa133f commit 2a1358f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions ovos_dinkum_listener/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"):
Expand All @@ -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}")
Expand All @@ -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()
Expand All @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion ovos_dinkum_listener/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a1358f

Please sign in to comment.