Commit Graph

14 Commits (e57671ebeb9f8821bd5740ed4f6690a3052ad35e)

Author SHA1 Message Date
Åke Forslund fa1bdfdda7 Send manifest before starting settingsmeta upload.
Minor restructuring moving the enqueuing of settingsmeta upload to after
updating the skills manifest.
2019-12-18 12:05:40 +01:00
Åke Forslund c11c9756ce Add queue system to send settingsmeta
The queue will store all settingsmeta upload calls and execute them
after pairing can be verified.

Starts settings download after upload has started. When settings meta upload
has started for all skills the skill download process is triggered.

This guarantees that the settingsmeta skill_gid has been populated
properly before skills try to figure out which part of the skills data
belongs to them.

Add docstrings to upload queue
2019-12-18 12:04:57 +01:00
Åke d30c50e752
Merge pull request #2283 from forslund/refactor/config-properties
Replace config properties to simpler instances
2019-09-26 14:51:56 +02:00
Åke Forslund b9097e43f2 Restructure to get skill_gid after startup 2019-09-18 19:59:13 +02:00
David Wagner f4865286ab
Merge pull request #2299 from forslund/bugfix/skills-reload-error
Catch exceptions when reloading skills
2019-09-17 19:24:04 -05:00
Chris Veilleux 5c742d2ed0 complete rethink of how settings and settingsmeta are handled in core. 2019-09-17 11:24:10 +02:00
Åke Forslund 74be9a8a2e Catch exceptions when reloading skills
- Explicitly catch FileNotFoundError
- Do a general catch and log for other exceptions
2019-09-11 14:20:22 +02:00
Åke Forslund ce772dd1ae Replace config properties to simpler instances 2019-09-01 12:18:27 +02:00
Åke 75ad11b9d0
Merge pull request #2256 from forslund/refactor-split-mycroftskill
Refactor MycroftSkill
2019-08-30 18:21:13 +02:00
Åke Forslund 02b49edc99 Fix typo when unreferencing skill after failed load 2019-08-30 14:57:27 +02:00
Åke Forslund a187a17d4d Set MycroftSkill.root_dir in __init__()
This also removes the _dir member which cointains the same information.
2019-08-30 13:00:26 +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 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
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