Commit Graph

1582 Commits (8420ec302cc35c1e65544caecc177849f92b7cbd)

Author SHA1 Message Date
Åke Forslund 8420ec302c intent_service is OBVIOUSLY not a package 2017-09-01 15:29:08 -05:00
jarbasai b6e89f02b0 pep8 2017-09-01 12:28:37 -05:00
Jarbas c05590bc7c save utterances 2017-09-01 12:28:37 -05:00
Åke Forslund 51f107f3e2 Fix required package intent_service
====  Tech Notes  ====
old intent directory was expected instead of intent_service
2017-09-01 12:05:24 -05:00
Matthew D. Scholefield ef759ce825 Add sphinx documentation 2017-09-01 12:01:59 -05:00
Åke Forslund c7c25cc01b Fix errors during shutdown
====  Tech Notes ====
Skills weren't cleanly shutdown. This ensures that skills are shutdown more cleanly and that shutdown procedure will not be interrupted by broken shutdown methods.

Shutdown of reload thread fixed

Unused globals removed
2017-09-01 10:53:22 -05:00
Åke Forslund 2881b1842f Setting storage is no longer forced at shutdown
Risk of corruption if the skill service was terminated while settings
were written was determined to be greater than any benefit from this.
2017-09-01 10:45:05 -05:00
Åke Forslund 0782064819 Write settings dict to disk more frequently
====  Tech Notes ====
After an intent has been handled the settings will be stored if any changes are detected.

A force option was added to the .store method of the settings class which always writes the dict to disk even if no changes has been made. This is used during shutdown.
2017-09-01 10:45:05 -05:00
Åke b1d02edf80 Merge pull request #1042 from MycroftAI/feature/script_tamer
Tame the mycroft.sh script

====  Tech Notes  ====
Try to shut down services cleanly by sending ^C and if that fails the skills are terminated hard.
2017-09-01 16:07:15 +02:00
Steve Penrod 370b51ff6a Tame the mycroft.sh script
The mycroft.sh script uses the 'screen' command to run the various
processes that make up Mycroft Core.  When they are stopped with
"./mycroft.sh stop", it was using the screen 'quit' command.  This
ends the process abruptly, not allowing services to shutdown
cleanly.

This changes it to send a shutdown request first, equivalent of a
Ctrl-C.  If the service doesn't shutdown after 2 seconds it is
then killed.

This specifically prevents issues where a skill expected and did
not receive a call to the shutdown() method.
2017-08-31 17:53:30 -07:00
Michael Nguyen 01a7868d49 Merge pull request #1003 from forslund/test-skills-core
Test skills core
2017-08-31 16:00:14 -05:00
Michael Nguyen 995d67e612 Merge pull request #1018 from forslund/bugfix/issue-1014
Bugfix/issue 1014
2017-08-31 15:59:32 -05:00
Michael Nguyen 2dc6e47bea Merge pull request #1020 from forslund/bugfix/issue-1019
Fix expect response for speak_dialog
2017-08-31 15:58:54 -05:00
Michael Nguyen e7775d26d0 Merge pull request #1026 from forslund/bugfix/issue-1022
Fix failure when using one_of in intents
2017-08-31 15:58:38 -05:00
Michael Nguyen 2dab08f483 Merge pull request #1035 from forslund/bugfix/localization
Bugfix/localization
2017-08-31 15:58:02 -05:00
Åke Forslund 144e9c016c Automatically find skill directory in __init__
====  Tech Notes ====
Previously the _dir parameter was poplated from the skill loader between calling __init__() and initialize(). The skill path can however be gleaned from with in the __init__() of MycroftSkill.

Doing this makes the settings accessable from __init__() as well and will allow a more straight forward usage.
2017-08-31 15:54:46 -05:00
Åke Forslund d746a87e34 Added docstring for update_context
Including note about not working on one_of keywords.
2017-08-31 21:34:30 +02:00
Åke 14254893cf Merge pull request #1023 from MatthewScholefield/feature/module-imports
====  Tech Notes ==== 
Adds the most commonly used methods and classes in more convenient location

Changing from mycroft.skills.core import MycroftSkill to simply from mycroft import MycroftSkill

====  Documentation Notes ==== 
The skill tutorial should be updated to use these shorter import paths.
2017-08-31 14:13:00 +02:00
Steve Penrod ae2583662f Correcting CLI handling of main() for issue #1036
The idiom for handling main() was incorrect to allow the CLI
to be invoked by the mycroft-cli-clent script.

==== Fixed Issues ====
2017-08-30 22:45:16 -05:00
Steve Penrod f9702157a6 Minor CLI fixes and enhancements
Several changes to CLI behavior, all minor:
* Inverted the behavior or PgUp/PgDn.  I think it was just wrong
* Added "oldest" and "newest" indicators to the log listing to
  simplify finding your way inside the logs
* Added support for _not_ scrolling when in the middle of the log
  output.  It will now only auto-scroll when already at the front
  of the log so you keep seeing new messages automatically.
* Added a heading for the mic output level
* Limited the mic output level to just the size of the bottom
  area (previously it was proportional to the screen height)
* FIX: Changed the default filter string for viseme
* FIX: The saving of settings was broken
* Ran autopep8 which added a few bits of whitespace here and there
2017-08-30 22:45:16 -05:00
Åke Forslund 9a6d282435 Warn when pocket sphinx model file is missing
====  Tech Notes ====
When a pocket sphinx model is missing an error is logged and the default
(us english) model is tried.
2017-08-31 00:19:00 +02:00
Åke Forslund de8dff6320 defaulting to TimeRulesEnUs now works
====  Tech Notes ====
Wheb a language without time rules were defaulted back to us-english
time rules the class was instanciated prematurely. Now the default
returns a class and not an object.
2017-08-31 00:18:43 +02:00
Åke Forslund ab44f24c22 Use io.open instead of open to load utf-8 dialog
==== Fixed Issues ====
#1027

====  Tech Notes ====
io.open is the default implementation of open for python3 and handles
encodings in a better way defaulting to utf8
2017-08-31 00:18:25 +02:00
Matthew D. Scholefield 789b452e5e Add useful imports to mycroft and mycroft.util modules 2017-08-29 11:09:12 -05:00
Åke Forslund 7022239456 Fix failure when using one_of in intents
==== Fixed Issues ====
#1022

====  Tech Notes ====
When a one_of intent is hit the intent returned by adapt doesn't look like normal require/optional intent parameters. This PR adds a check for entities before trying to accessing them when trying to update context.

This is a temporary workaround while it's determined if the adapt behaviour is correct or should be modified to conform to the normal format. (See issue 66 in the adapt repo), but in any case it's a good sanity check
2017-08-29 09:05:29 +02:00
Åke Forslund b44b2914af Fix expect response for speak_dialog
==== Fixed Issues ====
the expect_response pararmeter is now correctly passed along to
self.speak()

====  Tech Notes ====
NONE - explain new algorithms in detail, tool changes, etc.

====  Documentation Notes ====
NONE - description of a new feature or notes on behavior changes

==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
2017-08-25 14:26:33 +02:00
Åke Forslund 34a527b130 Add warning if skill isn't properly removed 2017-08-25 11:15:50 +02:00
Åke Forslund 3be861cee2 Fix trailing references causing memory leak
==== Fixed Issues ====

====  Tech Notes ====
This PR corrects a couple of small issues led to skills being left in memory when.
- Handler for `stop.mycroft` weren't removed from event emitter when
skill shut down. Now is added using `self.add_event()`
- registered intent list `self.events` created a circular reference that
python couldn't resolve a live so this is now deleted at shutdown
- Timers in scheduled skills weren't terminated properly. Now if the
timer is alive it will be joined

====  Documentation Notes ====
Registring event handlers should use `self.add_event` instead of
`self.emitter.on()` To make sure they are cleaned up when skill is
terminated.

==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
2017-08-25 11:15:50 +02:00
leonard-pradier 2e479dd453 Add french translation to the dialogs 2017-08-23 15:17:00 -05:00
Augusto Monteiro 53648b8433 Merge pull request #1012 from forslund/refactor/cleanup-skills
Cleanup skills
2017-08-22 15:03:55 -04:00
Augusto Monteiro c9c71670a6 Merge pull request #1006 from forslund/test/move-intent-service-test
Move intent_service tests to correct directory
2017-08-22 15:03:08 -04:00
Jarbas 684c08d4c0 Allow internal configuration changes PR #980
====  Tech Notes ====
Allow cached config to be updated from messagebus, from a skill or other connected software. Listens for configuration.patch signal and updates loaded config.

==== Protocol Notes ====
new messagebus signal configuration.patch
2017-08-22 14:50:31 +02:00
Åke Forslund b0f49b0d37 Add tests for location
====  Tech Notes ====
The tests mocks the configuration to ensure the location is what's
expected.
2017-08-22 14:11:48 +02:00
Åke Forslund 29f882b63d More tests of mycroft.skill.core
====  Tech Notes ====
Tests for open_intent_envelope() and MycroftSkill context methods added
2017-08-22 13:00:25 +02:00
Åke Forslund dea591e9b8 Cleanup imports 2017-08-22 08:45:06 +02:00
Åke Forslund e61b516ea1 Add more docstrings 2017-08-22 07:40:28 +02:00
Åke Forslund 12bf78cd5f Move funcs only used in skill_tester from core.py
====  Tech Notes ====
Some functions have been orphaned in core.py and are only used in the
tests. To clean up these have been moved to where they're used.
2017-08-21 15:59:48 +02:00
Åke Forslund bb0fbb51ed Cleanup skill service main
====  Tech Notes ====
Minor cleanup and comments
2017-08-21 15:59:48 +02:00
Augusto Monteiro 026a9991bf Merge pull request #1008 from forslund/bugfix/issue-1007
Fix skill container
2017-08-21 09:32:49 -04:00
Åke Forslund ebcbbd3a60 Fix skill container
==== Fixed Issues ====
#1007

====  Tech Notes ====
The converse system changed the api for the load_skill() function this
since the skill_container wasn't updated accordingly it stopped working.
This PR makes updates the container to use the new interface.
2017-08-21 15:09:51 +02:00
Åke Forslund 92d6b6865c Skill ID is not used instead of name in intents
====  Tech Notes ====
Converse fix changed registring intents using id number rather than name
2017-08-21 09:23:29 +02:00
Åke Forslund 9f2813be34 Add basic test case for loading skills
==== Fixed Issues ====
NONE - replace with associated issue numbers, e.g. #123, #304

====  Tech Notes ====
NONE - explain new algorithms in detail, tool changes, etc.

====  Documentation Notes ====
NONE - description of a new feature or notes on behavior changes

==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
2017-08-21 09:19:57 +02:00
Åke Forslund decc04d52a Add tests intent registration
==== Fixed Issues ====
NONE - replace with associated issue numbers, e.g. #123, #304

====  Tech Notes ====
NONE - explain new algorithms in detail, tool changes, etc.

====  Documentation Notes ====
NONE - description of a new feature or notes on behavior changes

==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
2017-08-21 09:19:57 +02:00
Jarbas f04f5107e7 small fix (#1005) Rebase issues with converse method
====  Tech Notes  ====
- Use skill id instead of name
- use time() function correctly
2017-08-21 09:18:01 +02:00
Åke Forslund 6a764ce44e Move intent_service tests to correct directory
==== Tech notes  ====
During a rebase the intent_service test wasn't moved to the correct
directory
2017-08-19 09:30:27 +02:00
Augusto Monteiro 67ea6f6298 Merge pull request #1002 from forslund/bugfix/issue-1001
Fix multiple reloads of skills at startup
2017-08-18 11:52:35 -04:00
Åke Forslund eb4991ade9 Fix multiple reloads of skills at startup
==== Fixed Issues ====
#1001

====  Tech Notes ====
Previously the skills were reloaded a couple of times during startup
since updates of the .pyc file and possible the settings.json file were
made.

This commit adds a bit finer control over which files to check.
Currently all files in skill root except ones ending in .pyc and the
settings.json are checked along with all visible subdirectories
2017-08-18 11:41:14 +02:00
Åke Forslund 0bd6c40694 Add fallback-aiml to defaults
====  Tech Notes ====
fallback-aiml was added to list of default skills in msm and the
requirement aiml==0.8.6 was added to requirements

====  Documentation Notes ====
NONE - description of a new feature or notes on behavior changes

==== Localization Notes ====
NONE - point to new strings, language specific functions, etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk, etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, APIs, etc.
2017-08-18 02:13:01 -05:00
Michael Nguyen f2f5925b09 fixing issue 998 2017-08-17 22:05:49 -05:00
Matthew D. Scholefield 9de5a13659 Add decorator support for intent files and fix regular decorator 2017-08-17 16:01:11 -05:00