Commit Graph

2624 Commits (65fcfcfcff67248829230823f6af91c5b14ce413)

Author SHA1 Message Date
JarbasAI 65fcfcfcff remove isSpeaking signal on audio startup (#1721)
* remove isSpeaking signal on audio startup

* clean import
2018-08-14 22:07:59 -05:00
Michael Nguyen 408f0ef4bc function to normalized all numbers to text equivalent (#1737)
Numbers are now normalized to the text equivalent. This is to solve problems where mimic2 returns a speed up text generation when saying number values.
2018-08-14 22:01:08 -05:00
Matthew D. Scholefield 6deafe42af
Merge pull request #1727 from juliengk/camelcase
Fix camel case splitting
2018-08-14 16:18:41 -05:00
Matthew D. Scholefield 0a66f90fe6 Upgrade to Padatious 0.4.5 (#1734) 2018-08-14 14:20:06 -05:00
Julien Kassar 24a80d60c3 Fix camel case splitting
Signed-off-by: Julien Kassar <github@kassisol.com>
2018-08-12 14:00:28 -04:00
Dominik aaae168672 some vocab/dialog was added (#1717) 2018-08-10 15:02:56 -05:00
Åke 01c66281f1
Merge pull request #1716 from ndarilek/dev
Better logging around why writing .PHO file fails.
2018-08-09 15:41:13 +02:00
Nolan Darilek adfd9154db Better logging around why writing .PHO file fails. 2018-08-06 20:28:52 +00:00
devs-mycroft 99b00bb776 Version bump from 18.2.11 to 18.2.12 2018-08-04 08:07:42 +00:00
Steve Penrod 609a09bbf3
Allow Padatious to override Adapt (#1713)
Allow a Padatious intent to override Adapt when it is VERY
certain that the utterance is directed at it.  (95% confidence
or greater.)  Right now that only occurs if the intent match
for the given phrase is perfect.

This solves this kind of issue:
* Adapt:  Matching on "Set" and "Alarm"
* Padatious: Handling "is an alarm set"

* Fix logic error for when no Padatious intent
2018-08-03 14:43:17 -05:00
Matthew D. Scholefield d49d991a84 Remove git locks when starting mycroft (#1715)
This is a preventative measure to fix errors with git lock files not being removed when devices are unplugged or processes are killed
2018-08-03 14:41:51 -05:00
Matthew D. Scholefield f8a17c03f7
Merge pull request #1712 from MycroftAI/feature/log-unification
start-mycroft.sh improvements (change log dir and exit 1 when out of date)
2018-08-03 02:14:37 -05:00
Robert Sprunk a70e9f6c3f Replace static /opt/mycroft in prepare-msm.sh (#1700)
Replace static /opt/mycroft to use the environment variable instead.
2018-08-03 00:06:17 -05:00
Steve Penrod 1c82945576 Move logs to /var/log/mycroft/ directory
Simplifies permissions and future log-rotations to have all logs
under a single folder instead of having to give permissions to each.
2018-08-02 23:57:13 -05:00
Steve Penrod d1d17c2e08 Fix accidental line-ending change 2018-08-02 23:34:44 -05:00
Steve Penrod f329051743 Move logs to /var/log in all cases
Previously, the location of the log files changed depending
on whether you were running on a Mark1/Picroft or under a
"Github" install.  Now they are always under the same directory
at /var/log/mycroft-*.log

This also updates the CLI to pull from that location always.

Additionally:
* Removed the nonfunctional 'wifi' option from start-mycroft.sh
* Made the validation for dev_setup.sh exit instead of just show
  a warning message in start-mycroft.sh
* Added code to allow dev_setup.sh to be run from different
  directories successfully
2018-08-02 21:21:30 -05:00
Michael Nguyen fe00294b4c Feature/mimic2 visemse (#1708)
* added ability to create visemes
* clean visemes code, added url to mycroft.conf
2018-08-02 15:08:10 -05:00
Julien Kassar ed556b09df Standardize shell scripts (#1711)
* Standardize shebangs
* Standardize spaces
* Standardize functions declaration
* Standardize conditional constructs
* Standardize double quotes
* Standardize command substitution
* Standardize sed command
2018-08-02 14:48:47 -05:00
Julien Kassar e482254172 Do not enter python virtual env when inside Docker container (#1710)
Using a virtual environment is not necessary under Docker, which is a controlled
environment on its own.  This uses the semi-standard existence check for ```.dockerenv```
as a way to detect when running in a Docker context.
2018-08-01 15:10:48 -05:00
Matthew D. Scholefield a233cf4fd8 Upgrade padatious (#1709)
This upgrades Padatious to include a fix with perfect intent matches. Now any perfect match should output a confidence of 1.0
2018-08-01 15:01:45 -05:00
Michael Nguyen 7b54149bcd
Merge pull request #1653 from JarbasAl/feature/pronounce_scientific
Feature/pronounce scientific
2018-07-31 13:04:14 -05:00
Steve Penrod 040b64d09d
Fix CLI screen corruption (#1704)
The CLI would often have temporary screen corruption.  This reworks
several things to correct that issue, although it looks like the
ultimate cause was drawing to the screen while in the middle of
waiting on a VT100 ESC keycode sequence.

* Rearchitected all screen drawing to run in a single thread.  Now
  call set_screen_dirty() instead of draw_screen()
* Added a lock on accessing the various Log buffers, preventing
  changes to the buffer in the middle of a redraw
* Modified key reading logic when ESC character is received.  Now
  uses a 1 second timeout if no subsequent keycodes are sent
* Catch several special exceptions.  Curses throws exceptions in some cases during get_wch(), such as
when you Ctrl+Z suspend the CLI the resume the process.  Also moved Ctrl+C processing into this exception handler.
2018-07-30 17:17:48 -05:00
Steve Penrod ec73b7d48e
Fix named event scheduling/deleting (#1705)
While working on the Alarm skill I discovered several issues with the
event scheduler.  This PR cleans up those findings and resolves several
other potential issues:

1) To avoid thread synchronization issues, the EventScheduler had several
queues which independently held objects to be added/deleted/updated.  However, the order of the events was undefined and got mixed since they were all batched together.  So, for instance, if skill code performed:
   self.add_event("foo", self.handle_foo)
   if SomeReason:
       self.cancel_event("foo")
The actual order of queue handling would perform Remove first, then Add which resulted in "foo" not being found for delete, but then added and left as an active event.

Now the EventScheduler protects the list using a Lock and the queues have been removed.  Modifications to the list happen immediately after obtaining the lock and are not batched up.

2) One-time events were triggered while the event was still in the EventScheduler list.  Now the entry is removed before invoking the handler.

3) Within the MycroftSkill.add_event(name, handler) is a local 'wrapper' method that actually makes the callback.  The MycroftSkill.remove_event(name) method attempted to find entries in the events list and the associated handler entries in the self.emitter to remove.  However, the emitter actually held the wrapper(handler), not the handler itself.  So the emitter handlers were left behind.

This was a quiet bug until the next time you scheduled an event of the same name.  When that second event finally triggered, it would fire off both the new and the old handler -- which snowballed in the 'skill-alarm:Beep' case, doubling and redoubling with every beep.

Now this cancels all the emitter listeners by name.  There is a very slim chance that someone has registered a listener with the same name, but since it is namespaced to "skill-name:Event" I think this is pretty safe.


Not technically related, but a failure that has been lurking for
some time and is a French unit test that doesn't work depending
on the time of day when the test is run.
2018-07-30 15:08:13 -05:00
Matthew D. Scholefield 017449b3c2
Merge pull request #1707 from MycroftAI/feature/enclosure-in-scripts
Add enclosure to the start/stop dev scripts
2018-07-27 15:49:46 -05:00
Steve Penrod 365d6d19a0 Add enclosure to the start/stop dev scripts
The start-mycroft.sh and stop-mycroft.sh scripts now automatically
run the enclosure client if the platform is defined as
"mycroft_mark_1".

Also corrected a copy/pasted comment and added a clarifying message during the stop when killing a process.

Add stop support for recent 'python3' change

Necessary after #1703

The -r option eliminates the quotes on output

Clean up the usage of jq, -r removes the quotes on output.  Also eliminated the python2 support in the regex ```[p]ython[2|3]``` and dropped the unnecessary ```[p]```.

Verify platform file existence before read

It might not exist on a desktop install.

Verify platform file existence before read
2018-07-27 15:48:08 -05:00
Julien Kassar 670994b804 Replace python with python3 in start-mycroft.sh script (#1703)
Signed-off-by: Julien Kassar <github@kassisol.com>
2018-07-27 01:30:39 -05:00
Josh Cox 2abb8fa74b Add Ogg123 support (#1678)
This is reimplementation of #1649 which became divergent.

## Description
Adds a Ogg123Service and a play_ogg exactly like Mpg123Service and play_mp3

## How to test
I have a skill for a podcast which does not have an mp3 feed:
https://github.com/joshuacox/skill-GNUworldOrder

## Contributor license agreement signed?
signed by @joshuacox
2018-07-26 22:25:39 -05:00
Matthew D. Scholefield 859da51fcc
Merge pull request #1706 from MycroftAI/feature/padatious-warning
Immediately speak warning while Padatious trains
2018-07-26 19:14:51 -05:00
Matthew D. Scholefield 3fbe12cc07
Make single thread log nicer 2018-07-26 18:57:36 -05:00
Steve Penrod 0eb29718f3 Remove commented-out code 2018-07-26 18:27:49 -05:00
Steve Penrod edc6ab1ed6 Immediately speak warning while Padatious trains
At startup, Padatious was blocking in the fallback while the
training occurred.  As a result, any attempts to use Mycroft
during that period would queue up rather than giving the
user feedback.  Now it immediately returns False, allowing
user notification to occur elsewhere.
2018-07-26 18:21:48 -05:00
Åke 9ae13be1d4
Merge pull request #1698 from MycroftAI/feature/upgrade-mycroft-deps
Upgrade mycroft-authored dependencies
2018-07-24 09:45:13 +02:00
Matthew Scholefield 67714e846e Upgrade mycroft-authored dependencies 2018-07-20 17:43:27 -05:00
devs-mycroft 9ad7bf79a3 Version bump from 18.2.10 to 18.2.11 2018-07-19 14:02:03 +00:00
Åke 1da82bdd95
Merge pull request #1696 from forslund/bugfix/padatious-wait-and-train
Fix updating padatious intents after intent load/reload
2018-07-19 14:19:50 +02:00
Åke Forslund b60320bcae Fix updating padatious intents after intent reload
Training is called from wait_and_train with None as message, this commit adds propper handling for this case.
2018-07-19 14:06:58 +02:00
Steve Penrod 0e61700e13 Allow reference dates with tzinfo (#1695)
* Allow reference dates with tzinfo

The extract_datetime_en() function could cause an exception if the currentData parameter contained tzinfo.
2018-07-19 10:48:39 +02:00
f-e-l-i-x 9e2dc9628e German formatting for Wolfram alpha skill responses in format_de.py (#1669)
Response formatting for German language ordinals depending on cases/prepositions for dates
"am 1. März" -> "am ersten März" (on the first of March)
"der 1. März" -> "der erste März" (the first of March)
"1. März" -> "erster März" (first of March)

Response formatting for mathematical results
"10 ^ 2" -> "10 hoch 2" (ten to the power of two)

Can be tested via the corresponding test_format_de or by using wolfram alpha skill:
"Was ist die Fläche von Canada"
"Wann ist George Washington geboren"
2018-07-19 02:44:33 -05:00
Åke c140d5b889
Merge pull request #1690 from MycroftAI/feature/ask-yes-no
Add new MycroftSkill.ask_yesno() method
2018-07-19 09:34:32 +02:00
Steve Penrod dd807b2b2e
Improve the standalone skill tester (#1683)
* Improve the standalone skill tester

Using the skill tester was difficult -- the skill author had to copy a file
locally, and figuring out what was wrong with a test wasn't obvious.  This
change improves it in several ways:
* The tester can now be run as a module, allowing any skill to be tested
  by entering the skill folder and running:
  ```
  python -m test.integrationtests.skills.runner
  ```
  Optionally you can pass along a path to the skill.
* The runner will display help with a '--help' parameter, pointing to
  documentation on creating the tests.
* Information on where the tests are expected is printed during execution
* The *.intent.json was reduced to simply *.json since this is under an
  ```test/intent/``` folder already.  (This is backwards compatible for
  existing intent tests.)
* The failing rule is now displayed at the bottom of the run report, making
  it easier to figure out where issues exist during test creation
* Headers and terminal colors are used in the output, making it easier to
  visually parse the output from the execution of tests.

====  Documentation Notes ====
Update the skill documentation to reflect using
  python -m test.integrationtests.skills.runner
instead of copying the skill_developers_testrunner.py.

NOTE: This does have to be performed within a developer venv in order to
access the test suite.  Consider moving this into a mycroft-core-dev package
in the future for Mark 1 / Picroft users.

* Quieting warning from Codacy

* Replace single_test with runner

Adds support for "test_env" to the runner script

* Update the discover_test to match the runner

- catch intent tests from *.json files
- add failure msg to assert

* Turn off color using MST_NO_COLOR env variable
2018-07-19 02:23:22 -05:00
Åke 5cfea7f2d9 Update default config (#1648)
- Remove unused entries for skills
- Correct the entry for the NewsSkill
2018-07-19 02:08:23 -05:00
Åke ad5ebcf63d Bugfix/unmunge (#1688)
* Fix cases where the unmunge misses keywords

The unmunge would invariably miss keys due to the fact that the dict is modified while being iterated. This breaks out the keys into a list before iterating through them to ensure that all original keys are checked.

* Clean up the unmunge function slightly
2018-07-19 02:03:43 -05:00
penrods b005ba6f59 Allow dialog param of get_response() to be a spoken string
This makes the dialog parameter dual-purpose.  It can be used as a
literal spoken string, or a dialog resource.  In the future the
announcement parameter can be retired.
2018-07-19 02:00:17 -05:00
Åke 031daac17b
Merge pull request #1693 from forslund/feature/better-time-parse-and-fix-date-formatting
better time parse and fix date formatting #1681 + #1689
2018-07-18 21:31:51 +02:00
Matthew D. Scholefield e73c6c8e09
Merge pull request #1694 from MycroftAI/mimic2 2018-07-18 13:11:59 -05:00
Michael Nguyen 1ab9ae3889 Add Mimic 2 TTS
* added asynchronous request to mimic2 backend to break up audio into chunks

 * add chracter threshold

 * refactored split_by_punctuation

 * add punctuation function to sentence chunks

 * fix spelling

 * some more spelling

 * added mimic2 in mycroftconf

 * removed unused imports
2018-07-18 13:10:07 -05:00
Michael Nguyen fb2a6209ee
Merge pull request #1506 from forslund/feature/vlc-update
Feature/vlc update
2018-07-18 11:28:33 -05:00
Matthew D. Scholefield 823bfd2828
Merge pull request #1687 from forslund/feature/cleanup-setup
Clean up setup scripts
2018-07-18 10:45:21 -05:00
Matthew D. Scholefield 0540229cc4
Merge branch 'dev' into feature/cleanup-setup 2018-07-18 10:44:41 -05:00
Matthew D. Scholefield 5ee51e048b
Merge pull request #1671 from forslund/bugfix/audio_test
Fix startup of audio-test
2018-07-18 10:32:13 -05:00