From 9d0d9e696f263ec6a899a122397501a5167e6526 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:20:23 +0000 Subject: [PATCH 1/3] fix:dict_iteration_error (#132) ``` 024-11-15 16:13:23.600 - skill-ovos-homescreen.openvoiceos - ERROR - dictionary changed size during iteration Traceback (most recent call last): File "/home/ovos/.venvs/ovos/lib/python3.11/site-packages/ovos_utils/events.py", line 78, in wrapper handler(message) File "/home/ovos/.venvs/ovos/lib/python3.11/site-packages/skill_ovos_homescreen/__init__.py", line 132, in handle_register_sample_utterances self.update_examples() # ensure homescreen re-renders ^^^^^^^^^^^^^^^^^^^^^^ File "/home/ovos/.venvs/ovos/lib/python3.11/site-packages/skill_ovos_homescreen/__init__.py", line 218, in update_examples for _skill_id, data in self.skill_examples.items(): RuntimeError: dictionary changed size during iteration ``` --- __init__.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/__init__.py b/__init__.py index 5a1a6a9..dbadc21 100644 --- a/__init__.py +++ b/__init__.py @@ -203,7 +203,8 @@ def handle_idle(self, message): self.bus.emit(Message("ovos.homescreen.displayed")) def update_apps_drawer(self): - apps = self.build_voice_applications_model() + apps = [{"name": data["name"], "thumbnail": data["icon"], "action": data["event"]} + for skill_id, data in dict(self.homescreen_apps).items()] self.gui["applications_model"] = apps self.gui["apps_enabled"] = bool(apps) @@ -215,7 +216,7 @@ def update_examples(self): if self.skill_info_api: examples = self.skill_info_api.skill_info_examples() elif self.settings.get("examples_enabled"): - for _skill_id, data in self.skill_examples.items(): + for _skill_id, data in dict(self.skill_examples).items(): examples += data.get(self.lang, []) examples = [e for e in examples if e.strip()] # ensure no empty strings if examples: @@ -382,16 +383,6 @@ def _load_skill_apis(self): LOG.error(f"Failed to import Info Skill: {e}") self.skill_info_api = None - def build_voice_applications_model(self) -> List[Dict[str, str]]: - """Build a list of voice applications for the GUI model. - - Returns: - List[Dict[str, str]]: List of application metadata containing - name, thumbnail path, and action event - """ - return [{"name": data["name"], "thumbnail": data["icon"], "action": data["event"]} - for skill_id, data in self.homescreen_apps.items()] - ##################################################################### # Handle Widgets def handle_timer_widget_manager(self, message): From e891a9cee136ca514ef76c1a2e8caed4d0a65bdc Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Fri, 15 Nov 2024 16:20:37 +0000 Subject: [PATCH 2/3] Increment Version to 2.0.1a1 --- version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.py b/version.py index 63ddfbb..238f928 100644 --- a/version.py +++ b/version.py @@ -1,6 +1,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 2 VERSION_MINOR = 0 -VERSION_BUILD = 0 -VERSION_ALPHA = 0 +VERSION_BUILD = 1 +VERSION_ALPHA = 1 # END_VERSION_BLOCK From b02ec14b56aa0ce85e859ca8cde47bab2892f216 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Fri, 15 Nov 2024 16:21:05 +0000 Subject: [PATCH 3/3] Update Changelog --- CHANGELOG.md | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a479fc..ead7fde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,32 +1,16 @@ # Changelog -## [2.0.0a1](https://github.com/OpenVoiceOS/skill-ovos-homescreen/tree/2.0.0a1) (2024-11-15) +## [2.0.1a1](https://github.com/OpenVoiceOS/skill-ovos-homescreen/tree/2.0.1a1) (2024-11-15) -[Full Changelog](https://github.com/OpenVoiceOS/skill-ovos-homescreen/compare/1.0.6a1...2.0.0a1) +[Full Changelog](https://github.com/OpenVoiceOS/skill-ovos-homescreen/compare/2.0.0...2.0.1a1) -**Breaking changes:** +**Fixed bugs:** -- feat: bus api for homescreen apps and examples [\#130](https://github.com/OpenVoiceOS/skill-ovos-homescreen/pull/130) ([JarbasAl](https://github.com/JarbasAl)) - -**Implemented enhancements:** - -- adopt skill.json for examples [\#104](https://github.com/OpenVoiceOS/skill-ovos-homescreen/issues/104) - -**Closed issues:** - -- Apps icons missing in the launch bar \(Mycroft 2\) [\#110](https://github.com/OpenVoiceOS/skill-ovos-homescreen/issues/110) - -**Merged pull requests:** - -- fix:examples\_visibility [\#109](https://github.com/OpenVoiceOS/skill-ovos-homescreen/pull/109) ([JarbasAl](https://github.com/JarbasAl)) - -## [1.0.6a1](https://github.com/OpenVoiceOS/skill-ovos-homescreen/tree/1.0.6a1) (2024-11-14) - -[Full Changelog](https://github.com/OpenVoiceOS/skill-ovos-homescreen/compare/1.0.5...1.0.6a1) +- use skills.json for examples [\#128](https://github.com/OpenVoiceOS/skill-ovos-homescreen/issues/128) **Merged pull requests:** -- nl-nl translation [\#127](https://github.com/OpenVoiceOS/skill-ovos-homescreen/pull/127) ([gitlocalize-app[bot]](https://github.com/apps/gitlocalize-app)) +- fix:dict\_iteration\_error [\#132](https://github.com/OpenVoiceOS/skill-ovos-homescreen/pull/132) ([JarbasAl](https://github.com/JarbasAl))