diff --git a/README.md b/README.md index 3116462..ec823a8 100755 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Query [Wikipedia](https://www.wikipedia.org) for answers to all your questions. NOTE: this will blacklist the official mycroft skill ![](./gui.gif) +![](./gui2.gif) ## Examples * "Tell me about Elon Musk" diff --git a/__init__.py b/__init__.py index e69044b..addb0ab 100755 --- a/__init__.py +++ b/__init__.py @@ -16,6 +16,7 @@ intent_file_handler) from mycroft.messagebus.message import Message from ovos_utils.skills import blacklist_skill +from os.path import join, dirname class WikipediaSkill(MycroftSkill): @@ -51,6 +52,8 @@ def handle_wiki_query(self, message): """ Extract what the user asked about and reply with info from wikipedia. """ + self.gui.show_animated_image(join(dirname(__file__), "ui", + "jumping.gif")) search = message.data.get("query") self.current_picture = None self.current_title = search @@ -73,9 +76,10 @@ def handle_wiki_query(self, message): @intent_handler("wikiroulette.intent") def handle_wiki_roulette_query(self, message): """ Random wikipedia page """ + self.gui.show_animated_image(join(dirname(__file__), "ui", + "jumping.gif")) self.current_picture = None self.current_title = "Wiki Roulette" - # TODO GUI animation self.speak_dialog("wikiroulette") if "lang" in self.settings: lang = self.settings["lang"] @@ -96,6 +100,7 @@ def _speak_wiki(self, data): self.current_picture = data["images"] self.current_title = data["title"] answer = data["summary"] + self.gui.clear() if not answer.strip(): self.speak_dialog("no entry found") return @@ -103,7 +108,7 @@ def _speak_wiki(self, data): self.idx = 0 self.results = answer.split(". ") self.speak_result() - self.set_context("wiki_article", search) + self.set_context("wiki_article", data["title"]) @intent_handler(IntentBuilder("WikiMore").require("More"). require("wiki_article")) diff --git a/gui2.gif b/gui2.gif new file mode 100644 index 0000000..0951d0e Binary files /dev/null and b/gui2.gif differ diff --git a/res/desktop/skill.json b/res/desktop/skill.json index 277f103..90e0055 100644 --- a/res/desktop/skill.json +++ b/res/desktop/skill.json @@ -4,7 +4,7 @@ "authorname": "JarbasSkills", "foldername": "", "url": "https://github.com/JarbasSkills/skill-wikipedia-for-humans", - "branch": "v0.2.1", + "branch": "v0.2.2", "desktopFile": false, "warning": "", "systemDeps": false, diff --git a/ui/jumping.gif b/ui/jumping.gif new file mode 100644 index 0000000..ac08192 Binary files /dev/null and b/ui/jumping.gif differ