Commit Graph

2316 Commits (be79b193b4d5b2672b0eaa744a2f1f68d2b986bd)

Author SHA1 Message Date
Chris Veilleux be79b193b4 changed to use newer version of msm_wrapper. 2019-08-23 16:07:46 +02:00
Chris Veilleux ebfd367b98 Changed skill manager and updater to reflect changes to MSM.
Cached the MSM creation logic to improve performance.
2019-08-23 16:07:26 +02:00
Åke 125ed57ac6
Merge pull request #2263 from forslund/bugfix/reload-deactivated-skill
Fix reload_allowed check
2019-08-22 21:13:35 +02:00
David Wagner f96a69227d W503 2019-08-22 20:48:07 +02:00
David Wagner 60c43ff3a6 close() on already closed file 2019-08-22 20:48:07 +02:00
David Wagner 4bc1e6dcc6 Keep audio frames immediately after wake word and send them to STT 2019-08-22 20:48:07 +02:00
Åke Forslund 8996972e78 Fix reload_allowed check
Fix logic precedence error and add test for the previous failing
condition.
2019-08-21 16:33:55 +02:00
Åke 4a9c2a4ed4
Merge pull request #2260 from forslund/bugfix/initialize-failure
Fix issue where skills fail during initialize()
2019-08-21 10:31:45 +02:00
Åke Forslund bd0456f4e6 Fix issue where skills fail during initialize()
An exception in skill's initialize method would be reraised and cause
the main loading routine to halt. This does not reraise the exception,
instead the instance reference is removed.
2019-08-21 10:11:47 +02:00
David Wagner e5f71cf12a
Merge pull request #2245 from forslund/bugfix/download-precise
Bugfix/download precise
2019-08-20 11:27:35 -05:00
Chris Veilleux 3bd3dd1bed Refactor skill manager (#2237)
Split skill_manager into three separate classes, SkillManager, SkillUpdater and SkillLoader splitting the responsibility into logical units

* Split the SkillManager.__init__ code to determine the download times into a new method
* Make docstrings consistent and PEP257 compliant.  Also fixed a couple of spelling errors
* fixed two issues introduced in the previous refactoring
* removed unnecessary assignment of an instance attribute to a local variable
* updated the unit test to mock out code that reaches outside of core, like MSM and the configuration manager.
* add several unittests and refactored load_priority method.
* add a test for the _get_last_modified_date function.
* add "quick" argument to docstring
* removed unused import
* new class containing the logic to periodically update/install skills and send skill manifests to the backend.
* import MsmException from where it is defined, not from the skill manager.
* add some logging to the skill updater
* remove code now in SkillUpdater from SkillManager
* added imports to __init__.py to define the API into the message bus package
* new base class for unit tests and module for reusable mocks
* new skill loader class that will replace the _load_or_reload_skill() method in the SkillManager class.
* moved skill loading logic from core.py into skill_loader.py, resulting in some refactoring of skill loader and skill manager.  change unit tests to match.
* added back some spacing that was inadvertently removed.
* change skill tester to use new SkillLoader class.
* Separate reload required check from performing reload to make logic easier
to follow
* Track skills that failed to load to handle infinite loop at first load
if skill fails to load
* Allow reloading skills that has failed to load
* Simplify first load of skills
- create activate, deactivate and unload methods for skill_loader
objects
- add sanity checks before activating and deactivating skills
- Update activation/deactivation test cases
2019-08-20 12:02:39 +02:00
Kris Gesling 3cacdaaaab
Fix TypeError for number values in settings
In some instances, the backend returns number setting values as an integer rather than a string.

This has been seen in the wild but has been difficult to replicate. The circumstances under which it happens are still unclear. I was able to semi-consistently have a number returned as int from the [Severe Weather Skill](https://github.com/domcross/severe-weather-information-skill) when editing an unrelated setting. To test, remove the 3 character country code (`[A-Z]{3} - `) from the service options of this skill .

This seems to be the quickest fix for it, but worth investigating further from the backend.
2019-08-17 08:36:00 +09:30
David Wagner 5f6db0941b
Merge pull request #2248 from forslund/feature/pairing-check-in-stt
Move pairing check to the relevant stt backends
2019-08-13 14:56:49 -05:00
David Wagner db2ea07f18
Merge pull request #2236 from forslund/bugfix/system-update
Allow startup if update attempt occurs
2019-08-12 14:31:34 -05:00
Åke Forslund 0801eda839 Fix delete_skill_metadata incorrect parameter name
change from the old uuid to the newer skill_gid fixing the invalid
reference to skill_gid.
2019-08-10 08:10:44 +02:00
Kris Gesling 754da78065
Merge pull request #2242 from cclauss/patch-2
Use ==/!= to compare str, bytes, and int literals
2019-08-08 06:26:57 +09:30
Kris Gesling 75c9addaa6
Merge pull request #2241 from cclauss/patch-1
Undefined name: Except --> Exception
2019-08-08 06:25:57 +09:30
Åke Forslund f727c00430 Move pairing check to the relevant stt backends
The pairing trigger should only be triggered by the 401 status for the
Mycroft hosted STT backends. Doing it for other STT's is only confusing.

This creates the decorator 'requires_pairing' that can be applied to the STT modules where it's relevant.

This adds the decorator to the MycroftSTT and the MycroftDeepSpeechSTT
2019-08-02 18:16:29 +02:00
Åke Forslund 6a2451bcbc Retry failed download of precise or use existing
Will retry the download of precise once per minute
2019-08-02 08:06:28 +02:00
Åke a140efe8f7
Merge pull request #2234 from c0r73x/dev
Some Swedish additions
2019-08-02 07:31:59 +02:00
Kris Gesling b357874c25
Merge pull request #2235 from MycroftAI/bugfix/padatious-detach-unregistered
Handle removing unregistered intents
2019-08-01 08:35:39 +09:30
Christian Clauss 517a0edaa2
Use ==/!= to compare str, bytes, and int literals
Identity is not the same thing as equality in Python

$ python
```
>>> 1 == 1.0
True
>>> 1 is 1.0
False
```
2019-07-31 00:13:44 +02:00
Christian Clauss 0053e70bc0
Undeefined name: Except --> Exception
__Except__ is an undefined name in this context with the potential to raise __NameError__ at runtime instead of the desired Exception and message.
2019-07-31 00:02:07 +02:00
Chris Veilleux d1915d3f95
Merge pull request #2180 from forslund/feature/is_paired-fail-early
Make is_paired fail early if no uuid in identity
2019-07-29 13:57:31 -05:00
c0r73x 357ddf9085 Added date_time for swedish 2019-07-27 22:11:30 +02:00
c0r73x e88e7c007d More fixes to swedish numbers 2019-07-27 20:27:51 +02:00
Åke Forslund e9cc683dbe Allow startup if update attempt occurs
update_attempt will block waiting for the update to complete and the
update will shutdown the running skills process if an update is needed.
2019-07-26 17:40:59 +02:00
Åke 7ebf58919e
Merge pull request #2233 from forslund/refactor/event-emitter
Small cleanup of the event scheduler
2019-07-26 17:10:23 +02:00
Åke Forslund 13db3d32a3 Handle removing unregistered intents
This small change adds a check that the intent has been registered
before removing it.

If an unregistered intent was removed padatious would silently throw an
exception due to a list operation error. But when run synchronously from
the skill tester this silent exception was actually loud causing skills
to fail to load.
2019-07-26 16:04:16 +02:00
Åke Forslund ad49c51ffc Minor cleanup of hotword_factory.py
- Reorder includes
- Add basic docstrings for the available engines
- simplify super()
- remove unneccessary "/" chars
2019-07-26 15:54:37 +02:00
Åke Forslund 9fda4e0670 Check if mic returned data before putting on queue
Mic may return None when aborted due to a reload of wake-word engine
2019-07-26 15:34:16 +02:00
Åke 5eba242487
Merge pull request #2221 from forslund/refactor/split-skills-core
Split mycroft.skills.core
2019-07-26 08:54:26 +02:00
Chris Veilleux 0bde1bc9df Refactor skill service (#2220)
Major refactoring of the skills startup sequence
- Restructure to a less nested structure
- Remove usage of globals by wrapping a lot of state variables into a class this allows for things like caching a negative pairing status throughout the startup process
2019-07-26 08:53:27 +02:00
c0r73x 4f92361bcc Added test_format_sv.py 2019-07-25 22:45:30 +02:00
c0r73x 9e37064408 Fixed format_sv 2019-07-25 21:49:50 +02:00
Åke Forslund 1f6adda6fd Small cleanup of the event scheduler
- Update docstrings
- Fix camelcase member
2019-07-25 08:44:20 +02:00
devs-mycroft acbb0f0dc2 Version bump from 19.2.13 to 19.2.14 2019-07-24 12:59:37 +00:00
Åke Forslund 846723cca0 Limit creation attempts of msm-lock
the msm-lock was created in global scope making all mycroft processes
trying to create it. This moves init to actual usage of the lock
2019-07-24 12:16:05 +02:00
Åke dbf0da6baf
Merge pull request #2230 from forslund/bugfix/message-bus-build-url
Bugfix/message bus build url
2019-07-24 09:06:07 +02:00
Åke Forslund 4034745340 Restore build_url static member to messagebus client 2019-07-24 08:49:44 +02:00
David Wagner ed6324d83b
tts_hash to an actual hash
tts_hash was initially set to the text of the config rather than hash so always loaded twice on boot (~750ms for create() for Mimic2)
2019-07-23 15:31:21 -05:00
Åke Forslund e87cf16a0d Make is_paired fail early if no uuid in identity
Refactors code so no request is sent to backend if the local identity
file is empty / has no uuid. Since if this part is missing core already
knows that it's not paired correctly.
2019-07-23 11:36:55 +02:00
Åke Forslund 0689f60747 remove "is True" check 2019-07-22 09:25:49 +02:00
Åke Forslund db94123d96 Replace oldstyle super class access with new 2019-07-22 09:24:36 +02:00
Åke Forslund 5dc8802146 Look over docstrings.
Update docstrings of the files affected by this reoriganization.
- PEP 257
- Add missing
2019-07-22 09:16:53 +02:00
Åke Forslund b7b5e9bfcb Refactor mycroft.skills.core
- MycroftSkill and related core functions to mycroft_skill.py
- FallbackSkill to fallback_skill.py
- Add important classes decorators and functions to __init__.py
- move SkillGUI class to the enclosure along with the other enclosure
  interfaces

core.py retains the same members as previously by means of imports to
retain backwards compatibility. When most of the available skills starts
using this new structure properly
2019-07-22 06:46:31 +02:00
Åke bb779e6136
Merge pull request #2217 from forslund/bugfix/quick-download
Move quick skill update to after internet check
2019-07-19 13:13:03 +02:00
Chris Veilleux edcc1c261e simplified super() call to use Python 3 syntax 2019-07-19 08:16:55 +02:00
Chris Veilleux 2c67381aee added module level docstring 2019-07-19 08:16:55 +02:00
Chris Veilleux be3dff99a1 added licence info to files without it and a missing docstring 2019-07-19 08:16:55 +02:00