Adds the mycroft.util.combo_lock ComboLock class for interprocess/Thread
lock.
Loading updated to be more reliable:
- Flush and sync file
- wait 1.2 seconds before load
Split the logic from the locking so the lock can be avoided when calling
update from save or load from get.
The "phonetic_spellings.txt" mechanism converts odd words to strings that
represent what they should sound like when spoken. For example, "mycroftai"
to "Mycroft A.I.". This provides an easy mechanism to provide hints to
lots of Text to Speech engines.
This adds it to Mimic2, along with a spelling of "corgi".
* Add "wait" option to MycroftSkill.speak() and speak_dialog()
The new "wait" option will cause the speak function to block until all
of the given dialog has been spoken by Mycroft. This means:
self.speak("Hello world", wait=True)
is now equivalent to:
self.speak("Hello world")
wait_while_speaking()
* Add ability to schedule event in seconds
The MycroftSkill.schedule_event() method now accepts an integer in addition to
a datetime for the 'when' parameter. The integer represents the number of
seconds in the future to fire off the event. E.g.
```python
self.schedule_event(some_handler, 7)
```
Will invoke some_handler() seven seconds from now.
Also unified language used in event docstrings.
Switch to an OrderedDict() for translate_namedvalues(), maintaining the
sequence of values defined in the original "list.value" file. This is
useful in circumstances where there are multiple values, but the order
of listing indicates some sort of preference.
This is used in the Alarm skill to allow synonyms like "weekdays"/"weekday",
"Mondays/Monday", but the first value is used when building the status string.
For example "You have an alarm for 8am on Mondays". Generically, this lets
translators consistently provide preferred names for values by adjusting the
order.
The mycroft.util.time.now_utc() was returning a naive datetime object, potentially causing
issues in skills running on instances that aren't using UTC system-wide. This didn't impact
Picroft or Mark 1, but Github installs would experience issues with skills such as the Alarm.
Adapt doesn't populate the entry from the one_of correctly from context. To work around the issue intent structure is scanned for empty keys and tries to populate them from entities in __tags__
* Add repeat option to audioservice
The audioservice.play() method now accepts a repeat parameter. If this
parameter is True the playlist passed to the audio service will be
repeated.
* Add repeat support to vlc
* Add the repeat parameter to all services
Not functional but playback will work at least. Hacktoberfest?
All credit to @adocampo who validated this fix on Arch/Manjaro.
I have built 18.8.1 on Ubuntu 18.04 LTS and it works perfectly with `pyyaml 3.13`
This fix should help those using Arch and derivatives like Manjaro.
Added functions for the spanish parser
* Added spanish function calls in parser.py for extractnumber_es
and extract_datetime_es
* Added spanish functions in util/paser_es.py for extractnumber_es
extract_datetime_es and added some missing numbers
Merged in changes from #1804
* Fix ambiguous time handling
In certain cases the ambiguous time handling skipped a day forward. This updates the logic to handle a bit better.
* Adds a test for the ambiguous time
* Remove references to timeStr
timeStr was never set and the logic that used it would never activate.
* Remove rename of currentDate
* Add extract_datetime parameter default_time
If a time is not found in the input string the time will be set from the
datetime/time object passed in as the default_time argument. If None the
time will be Midnight as previously.
Installation under Arch Linux wasn't working for many because the dependencies
hadn't been updated for Python 3. Mycroft would only work if all of the needed
components were already installed on the user's system.
Thanks to community member Chowbok for the help straightening this out!
The skill log is redirected to a string during loading and if the skill
fails to load the loading logs are outputed when the first test for the
skill is executed.
Allowing multiple dialog choices can help in cases where a skill has a number of dialog files that each can be triggered independently by the same intent. For example, the weather skill inquiry "will it rain" can trigger either a response when there is an upcoming rain and another if there's no rain in the near future.
```
"expected_dialog": ["dialog1", "dialog2"]
```
and
```
"expected_response": ["text 1", "text 2"]
```
is now possible. This will pass the test if a line from either dialog1 or dialog2 is matched. (or "text 1" or "text 2" is matched for "expected_response")