Skip to content

Commit

Permalink
Merge pull request #1773 from MycroftAI/bugfix/bad-walk
Browse files Browse the repository at this point in the history
Fix path in recent locale support
  • Loading branch information
forslund committed Aug 29, 2018
2 parents 979c021 + c13b40f commit 5c42ce8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mycroft/dialog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def load(self, dialog_dir):
if f.endswith(".dialog"):
self.__renderer.load_template_file(
f.replace('.dialog', ''),
join(directory, path, f))
join(path, f))
return self.__renderer


Expand Down
2 changes: 1 addition & 1 deletion mycroft/skills/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def find_resource(self, res_name, old_dirname=None):
root_path = join(self.root_dir, 'locale', self.lang)
for path, _, files in os.walk(root_path):
if res_name in files:
return join(root_path, path, res_name)
return join(path, res_name)

# Not found
return None
Expand Down
4 changes: 2 additions & 2 deletions mycroft/skills/skill_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def load_vocabulary(basedir, bus, skill_id):
for f in files:
if f.endswith(".voc"):
vocab_type = to_alnum(skill_id) + splitext(f)[0]
load_vocab_from_file(join(basedir, path, f), vocab_type, bus)
load_vocab_from_file(join(path, f), vocab_type, bus)


def load_regex(basedir, bus, skill_id):
Expand All @@ -97,7 +97,7 @@ def load_regex(basedir, bus, skill_id):
for path, _, files in walk(basedir):
for f in files:
if f.endswith(".rx"):
load_regex_from_file(join(basedir, path, f), bus, skill_id)
load_regex_from_file(join(path, f), bus, skill_id)


def to_alnum(skill_id):
Expand Down

0 comments on commit 5c42ce8

Please sign in to comment.