Commit Graph

3017 Commits (a76c3a6e7a0bc8551437766a381307ae06c3ddae)

Author SHA1 Message Date
Steve Penrod a76c3a6e7a Quiet PEP8 2019-02-14 15:49:05 -06:00
Steve Penrod de818db9cb Clean up some exception handling in settings code
The settings code worked, but was noisy and generally messy about
a few exceptional but common situations:
* When the .mycroft/skills/<SkillName> folder didn't already exist
* When network timeouts and such occcurred

I also slipped in a couple trivial code cleanups for an unused variable
and a log message.
2019-02-14 15:41:27 -06:00
Åke 98c0376966
Merge pull request #1978 from forslund/bugfix/sudo-check
Move sudo check to beginning of dev_setup.sh script
2019-02-03 09:18:35 +01:00
Åke Forslund 811e7e37e8 Move sudo check to beginning of script
The sudo command check was performed only when packages were installed and not before the interactve portion leaving $SUDO unset when trying to create the /opt/mycroft folder.
2019-02-02 23:15:50 +01:00
devs-mycroft b8beadfbf2 Version bump from 18.8.11 to 18.8.12 2019-01-31 14:03:20 +00:00
Åke 31656d6294 Add tests for commented dialogs and DialogLoader (#1853)
* Add tests for DialogLoader

* Handle Path/PosixPath

LOG messages when files/directories were missing would fail when a PosixPath/Path object was sent to as argument. This uses format to get the correct string representation.

* Add test for dialog.get()
2019-01-31 02:34:44 -06:00
Åke 8ff2ccc4fa
Merge pull request #1963 from forslund/feature/audioservice-prefer-local
Play on local audiobackends before trying remotes
2019-01-31 09:09:32 +01:00
Åke 2c858fba48 Add python version option to dev_setup.sh (#1952)
-p arg or --python arg allows the user to select which installed python version is used in the mycroft virtualenv.
2019-01-31 01:53:35 -06:00
Steve Penrod 01ea0afdeb
Minor edit of comments 2019-01-31 01:46:35 -06:00
Åke a94019a8b8 Use language set in mycroft configuration (#1925)
Slight refactoring to accommodate for this in a nice way. Created
function connect_to_mycroft() handling fetching the config and
connecting to the mycroft messagebus since these are related and the
order is important to maintain for it to work.
2019-01-31 01:38:47 -06:00
Åke 6b09770957
Merge pull request #1971 from forslund/feature/audio-test-basic-info
Add some additional info to audiotest
2019-01-31 08:36:46 +01:00
Åke 0ae66c3f93 Bugfix/speech stop (#1961)
* Refactor mimic2 to use the shared tts architecture

* Make sure the queue is cleared

- Add a convenience method grouping clear_queue and clear_visemes
- The start time is now set before the lock to allow multiple speech requests queued before the stop signal to also be cancelled
- Make sure the any pending TTS generation is cleared from the queue by calling tts.clear() when breaking from the chunking loop.
2019-01-31 01:30:53 -06:00
Åke 0a686be7d1 Add a decorator for simply adding idle pages (#1970)
To simplify the process of adding an idle page to a skill the decorator "resting_screen_handler" was added. In a skill class the decorator can be applied to a method to register it to handle idle.

    @resting_page_handler("My Idle Page")
    def handler(self, message):
        ...

The decorator will Register the method with the Mark-2 skill and perform all communications needed to make it work smoothly.
2019-01-31 01:22:33 -06:00
Steve Penrod df4f6ca6dd Fix typo and add --list option
The -l / --list option will now display the name and index of all available input devices.
2019-01-31 08:19:21 +01:00
Åke 267c7bf571 Single viseme message (#1973)
* Add new api command to send visemes as single list.  This allows more efficient use of the messagebus and gives implementors flexibility in how they handle the visualization.

* Switch mark1 to use viseme_list
2019-01-31 00:37:55 -06:00
Åke 60ab1aab69 Fix registering fallback (#1974)
The wrong method was registered, instead of the wrapped function call
the original method was registered. This led to not being able to
unregister fallbacks.
2019-01-31 00:21:15 -06:00
Åke a407691c81
Merge pull request #1969 from alistair23/alistair/sudo
Allow running mycroft on embedded devices without sudo
2019-01-28 17:47:01 +01:00
Åke Forslund 8693b71c0e Add some additional info to audiotest
Audiotest now prints the device and samplerate used as well as the commandline used to playback the audio for easier debugging if things doesn't work as intended.
2019-01-25 14:12:10 +01:00
Alistair Francis 50463d22f9 dev_setup: Don't abort if we don't have sudo but are running as root
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-22 10:43:47 -08:00
Alistair Francis 5a164dbc25 scripts/prepare-msm.sh: Use SUDO variable
Use the sudo variable and allow the script to run if we don't have sudo.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-22 10:43:36 -08:00
Alistair Francis 67fdc4ea10 dev_setup.sh: Use SUDO variable for all sudo commands
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-22 10:43:33 -08:00
Åke 9ef95506d0 GUI update number 6 (#1964)
* Add communication from GUI to skills

- "set" events from Qt will set/update a variable in the skills .gui member
- It's possible to add general event handlers using self.gui.register_handler()
- Moved registration of skill_id to just after skill init

* Ensure that simultaneously writes doesn't occur

Wrap WebSocketHandler.write_message() with a lock in an attempt to handle "buffererror: existing exports of data: object cannot be re-sized."

* Add better logging to help debug disconnect issue

* Allow overriding the idle page

SkillGUI.show_page() and SkillGUI.show_pages() now takes an optional
override_idle parameter. This is used as a hint by the mark-2 skill
and if possible the idle screen will not be shown.

* Improve debugging using Logger

* Raise exception when sending a non-existing gui page

* Restore running state to new connections

When a GUI is connected data and running namespaces are synchronised and
shown.

This refactors the code quite a bit moving the GUI state from the GUIConnection
object to the Enclosure.

The GUIConnection object does the handles the sync in the on_connection_open()
method.

* Add gui.page_interaction message

Currently triggered on page change on the display.

* Handle message when gui changes sessionData

* Check if socket exists on gui before sending data

* Increase port on each failure and retry
2019-01-22 08:45:19 -06:00
Åke 1b0ff61609
Merge pull request #1966 from MycroftAI/bugfix/issues-1962
Bugfix/issues 1962
2019-01-22 08:23:26 +01:00
Chris Rogers 12a55c4cb8 Issues-1962 - Fix/add tests for normalize 2019-01-21 18:44:20 -05:00
Chris Rogers 644d75cfc9 Issues-1962 - Revert changes to normalize_en 2019-01-21 18:37:04 -05:00
Åke Forslund 5c26a5d9a5 Play on local audiobackends before trying remotes
- Adds RemoteAudioBackend class, which is used to differentiate between
Remotes and local audio backends
- When searching for audio backends the backends are storted to first
check local ones and secondly remote ones
2019-01-21 16:10:24 +01:00
Å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