Skip to content

Commit

Permalink
ovos-plugin-manager validation
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 25, 2024
1 parent f4934a4 commit 4d2cbe6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ovos_config/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def autoconfigure(lang, online, offline, male, female):
except ImportError:
stdlang = lang
console.print(f"[red]ERROR: Failed to standardize lang tag, please install latest 'ovos-utils' package[/red]")

config = LocalConf(USER_CONFIG)
config["tts"] = {"ovos-tts-plugin-server": {}}
config["stt"] = {"ovos-stt-plugin-server": {}}
Expand Down Expand Up @@ -210,6 +211,21 @@ def do_merge(folder):
do_merge("online_female")

config["lang"] = stdlang

try:
from ovos_plugin_manager.stt import find_stt_plugins
from ovos_plugin_manager.tts import find_tts_plugins
available_stt = list(find_stt_plugins().keys())
console.print(f"INFO: available STT plugins: {available_stt}")
available_tts = list(find_tts_plugins().keys())
console.print(f"INFO: available TTS plugins: {available_tts}")
if config["tts"]["module"] not in available_tts:
console.print(f"[red]ERROR: TTS plugin seems to be missing, please install '{config['tts']['module']}'[/red]")
if config["stt"]["module"] not in available_stt:
console.print(f"[red]ERROR: STT plugin seems to be missing, please install '{config['stt']['module']}'[/red]")
except ImportError:
console.print(f"[red]ERROR: Skipping plugin validation, 'ovos-plugin-manager' not installed[/red]")

config.store()
console.print(f"Config updated: {config.path}")

Expand Down

0 comments on commit 4d2cbe6

Please sign in to comment.