* Add check for duplicate adapt intents
There are two cases, duplicated named intent and duplicated anonymous intent.
A named intent will cause a ValueError exception notifying the skill
author that there is a collision.
An anonymous intent will silently derive a new name and use that
instead of the default generated one.
* Add tests for intent collisions
* Make enable/disable intent handle the new exception
The enable/disable intent did not mark an intent as detached, instead it
remained in the list of intents after disabling in the IntentServiceInterface
to be retrieved when the intent should be re-enabled.
This moves detached intents into a list of detached intents to so they
won't cause the double enable exception.
* Add move logic to find if intent is detached
MycroftSkill.enable_intent() will now check if the intent is detached
before trying to re-enable it.
* Lock updates of intents
This should avoid some race conditions that may occur if multiple
threads tries to enable / disable intents
* Improve help message and logging
* Fix stray formatting
* Create /var/log/mycroft at the start of execution
* Make sure sudo is available
* Move function found_exe up
* Explicitly call out setup completion
* Add -a flag to append rather than overwrite
* Prefix the Alpine Linux virtual package name with a dot
This way the package is easy to recognize when inspecting
/etc/apk/world, and it's actually a standard to do so for virtual
packages
* Put all Alpine Linux deps on seperate lines
This way you get cleaner git diffs, showing more clearly what is
changing when adding or removing something
* Don't install pulseaudio-dev on Alpine Linux systems
It doesn't actually seem to be required by any of the PyPi deps
This makes the start and stop scripts compatible with POSIX shells.
Overview of the changes:
- "function" statements removed, not necessary and incompatible
- dashes in function and variable names for lower ones (- to _)
- source statements changed for .
- double square brackets replaced for single ones
- double equal statements replaced for single ones
- &> (piping stdout and stderr to the same file) replaced for 2>&1 >
- sourcing of mycroft-skill-testrunner replaced with direct execution
with Bash
- replaced BASH_SOURCE with $0, these scripts are never sourced anyway
- replaced "echo -n" statements with "printf"
- merged the "" and "all" cases to a single one
ShellCheck is a static analysis tool for shell scripts with the goal to:
- point out and clarify typical beginner's syntax issues that cause a
shell to give cryptic error messages
- point out and clarify typical intermediate level semantic problems
that cause a shell to behave strangely and counter-intuitively
- point out subtle caveats, corner cases and pitfalls that may cause an
advanced user's otherwise working script to fail under future
circumstances
I've ran this tool over both start-mycroft.sh and stop-mycroft.sh and
fixed any issue that popped up
When clearing VK test files - if some files didn't exist (because they weren't created) the bare rm command will report an error that the files didn't exist. We don't care, only that they are removed if they did exist.
Check if pipewire-pulse is installed, installs pulse otherwise
==== Fixed Issues ====
Partial fix: #2980
==== Tech Notes ====
pipewire-pulse is a compat layer, providing a pulseaudio API
* Fix Shellcheck: Add -r flag to read
read will mangle backslashes without it. These are not expected
characters so not explicitly necessary, but also won't hurt.
* Fix Shellcheck SC2086: Double quote variables
* Fix Shellcheck SC2004: dollar sign unnecessary on arithmetic vars
* Fix Shellcheck SC2129: use curly braces to >> file
* Disable shellcheck on sourced venv/bin/activate
* Fix Shellcheck SC1004
Simplify sed-expression to be a single line only removing the need for
the offending / and linefeed
* Fix Shellcheck SC2046 when finding repo root
Splits the check into to files to be able to quote the expressions
in a good way.
* Fix Shellcheck SC2086 Unquoted apt packagaes
This converts the variable APT_PACKAGE_LIST from a string to an array.
This is a safer way to handle arguments according to BashFAQ
(http://mywiki.wooledge.org/BashFAQ/050)
* Fix Shellcheck SC2230 by changing which to command -v
* CICD: Activate shellcheck job for dev_setup.sh
* Shellcheck start-mycroft.sh
This fixes the following shellcheck issues:
- https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |...
- https://www.shellcheck.net/wiki/SC2206 -- Quote to prevent word splitting/g...
- https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
- https://www.shellcheck.net/wiki/SC2124 -- Assigning an array to a string! A...
The command is added to the CICD run of shellcheck
* Shellcheck stop-mycroft.sh
Fixes the following issues:
- https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |...
- https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
The file is now automatically checked by the CICD job
* Shellcheck venv-activate.sh
Fix the following shellcheck issues:
- https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ...
- https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array. ...
- https://www.shellcheck.net/wiki/SC2128 -- Expanding an array without an ind...
- https://www.shellcheck.net/wiki/SC2139 -- This expands when defined, not wh...
- https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...
The help for invalid arg now works when the faulty argument isn't the
first argument
Co-authored-by: Kris Gesling <kris.gesling@mycroft.ai>
* Separate tests of LocalConf into new test class
* Do not overwrite configs with malformed json
If a config file is loaded and is invalid saves to that file will not be
possible until it's manually restored. The store accepts a force flag to
override this protection.
The method returns True if the store succeeded so call sites can
verbally report the issue as well.
* fix issues when remote excepts out
* Remove explicit clear_cache from MimicTTS
* Updates for using singleton TTS playback thread
- Cache is called on all tts's registered as using the thread
- Begin audio and end audio is handled by the playback thread
- Further changes from self.playback to TTS.playback for consistency
* Remove redundant try/except
* Consolidate general and TTS-specific sentence splitting
This performs all sentence-splitting at the same stage. This fixes a
subtle issue where a TTS splits a sentence into chunks and throws an
error on only one of those chunks. The fallback would generate a
sentence for the original un-chunked sentence. possibly saying the same
parts twice.
This also pre-compiles the regexes used to speed things up a bit.
Co-authored-by: Ken <ken.smith@mycroft.ai>
* Add `supported_languages` parameter to STT and TTS base classes
* Refactor `supported_languages` to `available_languages` and updated docstring to be more precise
* Remove unused scripts
install-pocketsphinx and install-pygtk is no longer used by the
dev-setup.
* Fix shellcheck issues in scripts
* Remove space in cores argument
* Update my-info.sh script
- Make it use the new method to activate venv if needed
- Improve requirements.txt parsing
- Update process detection from old "screen" setup
- Update log-files paths
- Fix finding mycroft-core folder
* Fix shellcheck issues in mycroft-use.sh
Mainly quoting but also unpacking of arguments and improving some if
statements
* Update shellcheck test to include scripts folder
* fix show text delegate as per autofit label refactor
* Make rectangle containing text transparent
For different background colors, the background on the card should be set.
Co-authored-by: Kris Gesling <kris.gesling@mycroft.ai>
This uses the existing dialog renderer and the standard format library
to in two steps create a regex where the {elements} in a dialog is
replaced with ".*" to match the given sentence.