Skip to content

Commit

Permalink
feat:prepare for other gui frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 20, 2024
1 parent 903b6d5 commit 5e2d377
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ovos_utils/gui.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from os.path import join, isdir
from typing import List

Expand Down Expand Up @@ -86,13 +87,12 @@ def get_ui_directories(root_dir: str) -> dict:
@return: Dict of framework name to UI resource directory
"""
ui_directories = dict()
base_directory = root_dir
if isdir(join(base_directory, "gui")):
LOG.debug("Skill implements resources in `gui` directory")
ui_directories["all"] = join(base_directory, "gui")
return ui_directories

if isdir(join(base_directory, "ui")):
if isdir(f"{root_dir}/ui"):
LOG.debug("legacy UI directory found - Handling `ui` directory as `qt5`")
ui_directories["qt5"] = join(base_directory, "ui")
ui_directories["qt5"] = f"{root_dir}/ui"
elif isdir(f"{root_dir}/gui"):
for framework in os.listdir(f"{root_dir}/gui"):
if isdir(f"{root_dir}/gui/{framework}"):
LOG.debug(f"Skill supports GUI framework: {framework} from folder: {root_dir}/gui/{framework}")
ui_directories[framework] = f"{root_dir}/gui/{framework}"
return ui_directories

0 comments on commit 5e2d377

Please sign in to comment.