From 420c6759dcf00bce120fb19ca310d19811af7712 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Fri, 15 Nov 2024 11:47:35 +0000 Subject: [PATCH 1/3] fix:lang_dir_crawling (#289) * fix:lang_dir_crawling finding default resource file directories wasn't quite right * @coderabbitai review --- ovos_workshop/resource_files.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/ovos_workshop/resource_files.py b/ovos_workshop/resource_files.py index 20e777f..53909cd 100644 --- a/ovos_workshop/resource_files.py +++ b/ovos_workshop/resource_files.py @@ -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 @@ -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 From c01be87804241801a677f64758c225e7a9733606 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Fri, 15 Nov 2024 11:47:53 +0000 Subject: [PATCH 2/3] Increment Version to 2.4.3a1 --- ovos_workshop/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovos_workshop/version.py b/ovos_workshop/version.py index a0d20b3..9b03a8e 100644 --- a/ovos_workshop/version.py +++ b/ovos_workshop/version.py @@ -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 From 69ae4b4b8235e052fd19e96f9128964918c52631 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Fri, 15 Nov 2024 11:48:22 +0000 Subject: [PATCH 3/3] Update Changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 886658f..8c1abd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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))