Skip to content

Commit

Permalink
WIP support UI resource upload
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jun 27, 2023
1 parent 5617db1 commit 907b3e9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ovos_workshop/skills/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from hashlib import md5
from inspect import signature
from itertools import chain
from os.path import join, abspath, dirname, basename, isfile
from os.path import join, abspath, dirname, basename, isfile, isdir
from threading import Event
from typing import List

Expand Down Expand Up @@ -95,7 +95,13 @@ class SkillGUI(GUIInterface):

def __init__(self, skill):
self.skill = skill
super().__init__(skill.skill_id, config=Configuration())
ui_dir = join(self.skill.root_dir, "ui")
ui_directories = dict()
if isdir(ui_dir):
ui_directories["ui"] = ui_dir
# TODO: Support other UI resource directories
super().__init__(skill.skill_id, config=Configuration(),
ui_directories=ui_directories)

@property
def bus(self):
Expand All @@ -106,11 +112,6 @@ def bus(self):
def skill_id(self):
return self.skill.skill_id

def setup_default_handlers(self):
"""Sets the handlers for the default messages."""
msg_type = self.build_message_type('set')
self.skill.add_event(msg_type, self.gui_set)

def register_handler(self, event, handler):
"""Register a handler for GUI events.
Expand Down

0 comments on commit 907b3e9

Please sign in to comment.