Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:prepare for other gui frameworks #270

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading