Commit Graph

3192 Commits (0a748b2636656880120c7dc62dafe9b6eae8528d)

Author SHA1 Message Date
Åke 7fd59bf488
Merge pull request #1958 from alistair23/alistair/utf8-encoding
dialog: Open template file as utf8 encoded
2019-01-18 10:36:23 +01:00
Alistair Francis 71afcb9ce5 text_client.py: Don't log stack trace on missing conf (#1957)
If we are missing the ".mycroft_cli.conf" file we print a message to the
user informing them that we are ignoring the missing file along with a stack trace. The stack trace is really not necessary so this removes it.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-18 09:59:55 +01:00
Alistair Francis 4c140c3cfe dialog: Open template file as utf8 encoded
To avoid UnicodeDecodeError's when opening files tell Python that we
want to open the file as a utf8 encoded file.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-17 11:45:14 -08:00
devs-mycroft ce37c7861b Version bump from 18.8.10 to 18.8.11 2019-01-17 14:46:19 +00:00
Åke 06f9d2f4db
Merge pull request #1956 from MycroftAI/feature/threaded-common-query
Run common query skill queries in threads
2019-01-17 12:38:12 +01:00
Åke Forslund d5f04ada76 Run queries in threads 2019-01-17 12:00:37 +01:00
Åke f98e569259
Merge pull request #1955 from MycroftAI/revert-threaded-emitter
Revert "Merge pull request #1889 from forslund/feature/threaded-emitter"
2019-01-17 11:54:09 +01:00
Åke Forslund f106f9603f Revert "Merge pull request #1889 from forslund/feature/threaded-emitter"
This reverts commit cb891ecf2f, reversing
changes made to 876b5393f7.
2019-01-17 11:11:43 +01:00
Åke 3c032734e5
Merge pull request #1954 from MycroftAI/bugfix/cli-ctrl-c
Fix Ctrl+C handling in CLI
2019-01-17 09:48:44 +01:00
Steve Penrod b38668a2ef Fix Ctrl+C handling in CLI
Ctrl+C was not being properly handled by the CLI, resulting in an  unclean
shutdown and other unexpected consequences -- e.g. a
"./start-mycroft.sh debug" would kill the background processes on exit.  The
KeyboardException was never being triggered.

Now the SIGINT is being captured and Ctrl+C behaves (as intended) just like
pressing Ctrl+X.
2019-01-17 09:47:43 +01:00
Matthew D. Scholefield cb891ecf2f
Merge pull request #1889 from forslund/feature/threaded-emitter
Run emitter using threadpool
2019-01-16 10:37:38 -06:00
G3RB3N 876b5393f7 Dev add nl nl (#1906)
* Added nl-nl voc, dialogs and formatter
2019-01-16 13:48:41 +01:00
Åke Forslund 19e8fc40d6 Update pyee to 5.0.0
Also update adapt to 0.3.2 to since it also depends on pyee
2019-01-15 19:52:44 +01:00
Matthew Scholefield c3b7060330 Add failing unit tests for threaded event emitter 2019-01-15 12:32:32 -06:00
Åke af8ded248c Set pep8-speaks line lenght limit to 79 (#1953)
This matches the travis check we're doing.
2019-01-15 10:18:26 -06:00
Åke 48bda2a754
Merge pull request #1935 from MycroftAI/feature/start-stop-tweaks
Tweaks to start/stop scripts
2019-01-15 09:23:34 +01:00
Steve Penrod dd697cb765 Tweaks to start/stop scripts
Several minor changes:
* Add mycroft-start and mycroft-stop, which can be used as commands anywhere
  if the user has added this to the PATH.  They are shortcuts to the
  start-mycroft.sh and stop-mycroft.sh scripts.
* Add to the mycroft-help command reference
* Add "reset" parameter for start-mycroft.sh, which forces a service restart.
  If a service is currently running, it will not restart by default anymore.
* Make the 'enclosure' service part of 'all' regardless of platform.  This
  makes sense not that it can handle a remote GUI connection.
* BUG: mycroft-stop would sometimes show odd messages if the skill process
  had active child processes.
2019-01-15 09:08:13 +01:00
ludwhe 8b71b89cf8 Better feed back for missing intent/entity files 2019-01-14 08:56:35 +01:00
Åke Forslund 555031762a Run emitter using threadpool
This moves the thread pool from the websocket client into the eventemitter allowing each registered function to run in a separate thread and not just each event.

This speeds up cases where there is a one to many call such as the common play framework and the upcomming common query framework.
2019-01-14 07:29:43 +01:00
Åke 670ece35dc
Merge pull request #1944 from JarbasAl/feature/audio_seek
Add seek functionality to audioservice.
2019-01-12 15:14:46 +01:00
jarbasal 15141528bd vlc audio length check 2019-01-12 13:10:54 +01:00
jarbasal 1c3543f5e5 Support for audio seek
The audioservice can now jump forward and backward in the audio stream/file

The functionality is accessed via the audioservice class's seek_forward(),
seek_backward() and seek() methods
2019-01-12 13:10:54 +01:00
Åke 4e10339f55
Merge pull request #1912 from aleale99/dev
Updated:
- nice_date()
- pronounce_number()
2019-01-12 13:07:19 +01:00
Kathy Reid 92c479e1b6
Merge pull request #1948 from MycroftAI/penrods-patch-1
Remove depth=1, which breaks the dev_setup wizard
2019-01-12 06:58:16 +11:00
Matthew D. Scholefield 053c329f34
Merge pull request #1945 from forslund/refactor/remove-object
Remove inheritance from object
2019-01-11 09:18:39 -06:00
Åke Forslund 38701a9790 Remove inheritance from object
Inheriting from object isn't necessary in python3.
2019-01-11 09:24:21 +01:00
Steve Penrod b6f3a531e2
Remove depth=1, which breaks the dev_setup wizard
Fixes problem described in #1946
2019-01-10 16:46:41 -06:00
Åke fa5c9abd78 GUI Cleanup (#1939)
* Try to improve stability

- Remove sync_active
- Update the way variables are sent to the gui

* Do not show full path for pages

The cli now shows the basename of the current page to make it easier to
determine if the correct page is displayed.

* Make elements in loaded list named tuples

This makes the intent of the code a bit cleaner.
2019-01-09 20:09:21 -06:00
Åke 74ae24ec7e
Merge pull request #1936 from MycroftAI/feature/select-mic-by-name
Support selecting microphone by name
2019-01-08 08:49:48 +01:00
Åke Forslund ff04af99c9 Move the device finding code into an util function 2019-01-08 08:05:07 +01:00
Steve Penrod 2557637591 Support selecting microphone by name
Normally Mycroft will use the default PortAudio input device as the
microphone input for the user.  However in some cases there is reason
to specify a different input.

The "device_index" under the "listener" section in mycroft.conf has
always allowed a user to select the microphone explicitly.  But on
some systems the indices can change from reboot to reboot.  So this
adds the "device_name" setting.  If it exists (and the "device_index"
has not been specified explicitly), a regex match will be run against
the PortAudio device names.

When "device_name" is used, the voice.log will contain a listing of
the devices as they are tested.  This can be used to debug if a
name isn't matching as expected.

EXAMPLES:
/etc/mycroft/mycroft.conf
```
{
    "listener": {
        "device_name": "aawsrc"
    }
}
```
Would find a match against "aawsrc" or "aawsrcplug".  To force a specific
match, you can use a regex such as "aawsrc$".

/etc/mycroft/mycroft.conf
```
{
    "listener": {
        "device_index": 2
    }
}
```
The PortAudio device index specified will be used.

Names and indexes for PortAudio are difficult to guess.  The simplest way to
view them is either enter a value for "device_name" and look at the names
which appear in the log when starting Mycroft, or to run a simple program
such as:
```python
import pyaudio

pa = pyaudio.PyAudio()
for i in range(pa.get_device_count()):
    dev = pa.get_device_info_by_index(i)
    print((i, dev['name'], dev['maxInputChannels']))
```
2019-01-08 07:51:41 +01:00
Åke e08075dd61
Merge pull request #1933 from MycroftAI/cve/remove-pyyaml
Remove pyyaml as a dependency
2019-01-07 17:30:04 +01:00
Kathy Reid aa05f5540f Remove pyyaml as a dependency
==== Fixed Issues ====
CVE-2017-18342
https://nvd.nist.gov/vuln/detail/CVE-2017-18342
high severity
Vulnerable versions: < 4.2b1
Patched version: 4.2b1
In PyYAML before 4.1, the yaml.load() API could execute arbitrary code.
In other words, yaml.safe_load is not used.

====  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.
2019-01-08 02:49:52 +11:00
Ale 8f0e6787f3
Update parse_it.py
correct import
2019-01-05 09:58:21 +01:00
Ale 4270fd4528
Update parse_it.py
imported too early, the functions that use them are not yet ready
2019-01-04 18:39:54 +01:00
adam 07f2132689 Use builtin cd for venv-activate.sh
`builtin cd` is safer, as simple `cd` may fail when cd is aliased to something
that outputs to stdout in the local environment
2019-01-03 19:18:24 -05:00
Matthew D. Scholefield dcbda23482
Merge pull request #1930 from forslund/feature/dev-setup-pip
dev_setup: Exit if pip installation fails.
2019-01-03 15:56:08 -06:00
Åke Forslund e24b898d09 Exit setup if pip installation fails. 2019-01-03 19:25:59 +01:00
Ale 3fc29e0e96
insert test and cleanup
specific test for  short_scale=True
2019-01-03 18:16:09 +01:00
devs-mycroft 615fa648f9 Version bump from 18.8.9 to 18.8.10 2019-01-03 09:59:16 +00:00
Åke c92f92de4f Bugfix/mimic2 negative numbers (#1927)
* Fix mimic2 negative numbers

Make the regex extracting numbers also match negative numbers when preparsing phrases sent to the mimic2 service

* Update pronounce_number to use "minus" for negatives

After discussion in the chat it was suggested to use "minus" for negatives as default.

When scientific notation is used the term "negative " is still used.
2019-01-02 16:36:04 -06:00
Ale a6eff4c750
cleanup 2018-12-31 16:56:54 +01:00
Ale 3d3bccb3bb
Update parse_it.py isFractional_it with
with short_scale =False
2018-12-31 16:45:06 +01:00
Ale f8515fdf79
Update format_it
italian use short_scale=False
2018-12-31 16:34:17 +01:00
Steve Penrod 8fe127bd5d Improve setup and start-mycroft scripts (#1924)
Improved the dev_setup.sh in several ways:
* Add 'wizard' that walks new users through setup
  - Option to put the mycroft-core/bin folder in the path
  - Option to change to 'master' instead of 'dev' branch.  This is
    usually desirable for users who only run Mycroft, not developers.
  - Option to auto-update when running Mycroft
  - Add soft link <mycroft-core>/skills to the /opt/mycroft/skills
    directory

Improve the start-mycroft.sh script
* Unify some duplicated code under init-once() function
* Add support for "auto-update", which attempts a git pull at startup
* Add require-process() function which doesn't restart already
  running services
* Add require-process for messagebus and skills services when running
  the CLI
* Tweak the --help message
2018-12-31 14:05:09 +01:00
Åke 2e9d764d36 GUI update (#1922)
Several additions to the GUI protocol support

These changes allow switching between pages successfully with the current
mycroft-gui widget:
* Optimized commands to handle the active skill list
* MycroftSkill.gui.show_pages(list, idx) allows multiple-pages to be displayed
  at a time starting with the given index visible.
* Merge SkillGUI.show_page with show_pages
  This limits code duplication and makes things a bit more maintainable.
* Do not reload on changed .qmlc files
* Make EnclosureGeneric derive from Enclosure
* Update show function to match mycroft-gui-app
  - adds internal representation of all loaded skills
  - uses new commands to switch between pages and namespaces
* Add Extra debug output in enclosure
  - Log if starting websocket fails
  - Log the sending of page info in more detail
* Update GUI Debug client in CLI
  - The CLI GUI now handles the new messages for switching pages
  - Handle different data types better by using format instead of string concatenation
* Disable syncing code.
  The sync code at startup outdated and needs to be reworked. Disabling it for now
  to allow better interaction.
* Minor cleanups
  - do not inherit from object
  - use format instead of string concatenations
  - remove duplicated self.loaded
  - correct private member access
* Refactor GUIConnection.show()
   Move the actions into separate methods for better overview of the logic
* Flipped "valid_file" to become "ignored_file"
2018-12-29 21:35:48 -06:00
Åke b194b51bcf
Merge pull request #1920 from MycroftAI/feature/barge-in
Add basic barge-in functionality
2018-12-29 08:40:30 +01:00
Åke fa56e91b00 Minor update to dialog (#1911)
* Do not load blank lines as dialogs.

* Simplify render code slightly using random.choice

* Remove import of io's open, not needed in python 3
2018-12-28 19:48:22 -06:00
Steve Penrod 1427992c99 Add basic barge-in functionality
The ability to "barge-in" has been lacking from Mycroft Core.  The Mark 1
microphone was unable to support this due to physical limitations, but the
Mark II and other implementations with more advanced mic tech which can
hear over themselves are able to continuously listen.

To enable this while retaining backwards compatibility with simpler mic.py
systems, there are now two mycroft.conf values:

{
   "listener": {
        "mute_during_output" : true,
        "duck_while_listening" : 0.3
   }
}

The above values are defaults, and implementers will likely override them
using the /etc/mycroft/mycroft.conf file when appropriate.

The duck_while_listening setting is currently handled in Mycroft's
skill-volume.  The mute_during_output is handled within mycroft-core itself.
2018-12-28 18:12:42 -06:00
Matthew D. Scholefield 531c5e51c1
Merge pull request #1919 from MycroftAI/yaml-doc-backend
Adding swagger yaml file for the API calls that mycroft core does
2018-12-28 12:00:10 -06:00