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

Release 2.4.3a1 #290

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changelog

## [2.4.2a1](https://github.com/OpenVoiceOS/OVOS-workshop/tree/2.4.2a1) (2024-11-15)
## [2.4.3a1](https://github.com/OpenVoiceOS/OVOS-workshop/tree/2.4.3a1) (2024-11-15)

[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/2.4.1...2.4.2a1)
[Full Changelog](https://github.com/OpenVoiceOS/OVOS-workshop/compare/2.4.2...2.4.3a1)

**Merged pull requests:**

- fix:ensure path exists [\#287](https://github.com/OpenVoiceOS/OVOS-workshop/pull/287) ([JarbasAl](https://github.com/JarbasAl))
- fix:lang\_dir\_crawling [\#289](https://github.com/OpenVoiceOS/OVOS-workshop/pull/289) ([JarbasAl](https://github.com/JarbasAl))



Expand Down
21 changes: 5 additions & 16 deletions ovos_workshop/resource_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def locate_base_directories(skill_directory: str,


def locate_lang_directories(lang: str, skill_directory: str,
resource_subdirectory: Optional[str] = None) -> \
List[Path]:
resource_subdirectory: Optional[str] = None) -> List[Path]:
"""
Locate all possible resource directories found in the given skill_directory
for the specified language
Expand Down Expand Up @@ -214,32 +213,22 @@ def locate_base_directory(self, skill_directory: str) -> Optional[str]:
the skill's directory for the resource type or None if not found
"""
resource_subdirectory = self._get_resource_subdirectory()

if not self.language:
self._locate_base_no_lang(skill_directory, resource_subdirectory)
return

# check for lang resources shipped by the skill
possible_directories = [Path(skill_directory, "locale", self.language)]
possible_directories = []
if resource_subdirectory:
possible_directories += [
Path(skill_directory, resource_subdirectory, self.language),
Path(skill_directory, resource_subdirectory)
]
subdirectory_path = Path(skill_directory).joinpath(resource_subdirectory)
possible_directories += self.locate_lang_directories(str(subdirectory_path))
possible_directories += self.locate_lang_directories(skill_directory)

for directory in possible_directories:
if directory.exists():
self.base_directory = directory
return

# check for subdialects of same language as a fallback
# eg, language is set to en-au but only en-us resources are available
similar_dialect_directories = self.locate_lang_directories(skill_directory)
for directory in similar_dialect_directories:
if directory.exists():
self.base_directory = directory
return

# check for lang resources defined by the user
# user data is usually meant as an override for skill data
# but it may be the only data source in some rare instances
Expand Down
4 changes: 2 additions & 2 deletions ovos_workshop/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 2
VERSION_MINOR = 4
VERSION_BUILD = 2
VERSION_ALPHA = 0
VERSION_BUILD = 3
VERSION_ALPHA = 1
# END_VERSION_BLOCK