forked from MycroftAI/mycroft-core
-
Notifications
You must be signed in to change notification settings - Fork 16
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
improve_fallback_timeout #506
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a28fb47
improve_fallback_timeout
JarbasAl e88334b
fix/fallback_timeout_handling
JarbasAl b20279b
fix tests
JarbasAl c70c0f5
fix duplicated messages
JarbasAl c01c866
Update requirements.txt
JarbasAl 4df34e4
"max_skill_runtime"
JarbasAl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import time | ||
|
||
from ovos_workshop.decorators import fallback_handler | ||
from ovos_workshop.skills.fallback import FallbackSkill | ||
|
||
|
||
class SlowFallbackSkill(FallbackSkill): | ||
|
||
@fallback_handler(priority=20) | ||
def handle_fallback(self, message): | ||
while True: # busy skill | ||
time.sleep(0.1) | ||
self.speak("SLOW") | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python3 | ||
from os import walk, path | ||
|
||
from setuptools import setup | ||
|
||
URL = "https://github.com/OpenVoiceOS/ovos-skill-slow-fallback" | ||
SKILL_CLAZZ = "SlowFallbackSkill" # needs to match __init__.py class name | ||
PYPI_NAME = "ovos-skill-slow-fallback" # pip install PYPI_NAME | ||
|
||
# below derived from github url to ensure standard skill_id | ||
SKILL_AUTHOR, SKILL_NAME = URL.split(".com/")[-1].split("/") | ||
SKILL_PKG = SKILL_NAME.lower().replace('-', '_') | ||
PLUGIN_ENTRY_POINT = f'{SKILL_NAME.lower()}.{SKILL_AUTHOR.lower()}={SKILL_PKG}:{SKILL_CLAZZ}' | ||
|
||
|
||
# skill_id=package_name:SkillClass | ||
|
||
|
||
def find_resource_files(): | ||
resource_base_dirs = ("locale", "ui", "vocab", "dialog", "regex", "skill") | ||
base_dir = path.dirname(__file__) | ||
package_data = ["*.json"] | ||
for res in resource_base_dirs: | ||
if path.isdir(path.join(base_dir, res)): | ||
for (directory, _, files) in walk(path.join(base_dir, res)): | ||
if files: | ||
package_data.append( | ||
path.join(directory.replace(base_dir, "").lstrip('/'), | ||
'*')) | ||
return package_data | ||
|
||
|
||
setup( | ||
name=PYPI_NAME, | ||
version="0.0.0", | ||
package_dir={SKILL_PKG: ""}, | ||
package_data={SKILL_PKG: find_resource_files()}, | ||
packages=[SKILL_PKG], | ||
include_package_data=True, | ||
keywords='ovos skill plugin', | ||
entry_points={'ovos.plugin.skill': PLUGIN_ENTRY_POINT} | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE for reviewers: this would repeat the ping/pong bus message pattern once per skill, it can't be used inside the iterator