Commit Graph

1947 Commits (60ab1aab69996ee756bd124abf19d5f3b4ff83db)

Author SHA1 Message Date
Ale c8cfada9c6 Italian minor update in res/text/it-it/ (#1910)
Italian: minor update
2018-12-17 19:19:00 +01:00
Ale 12b2ee2350
Italian minor update created yes.voc 2018-12-17 19:00:10 +01:00
Ale 49c90109b6
italian minor update create skill.error.dialog 2018-12-17 18:57:34 +01:00
Ale 5672354d0b
italian minor update on phonetic_spellings.txt 2018-12-17 18:55:59 +01:00
Ale 2c32b6e3f0
Italian update: created file not.loaded.dialog 2018-12-17 18:54:30 +01:00
Ale a5e503919e
Italian: minor update 2018-12-17 18:51:50 +01:00
Ale 70b30f981f
Italian minor update: crate file no.voc 2018-12-17 18:50:02 +01:00
Ale 047d549755
Italian: minor update 2018-12-17 18:46:45 +01:00
Åke Forslund 3175baa2eb Stop hotword engines during reload
- Add overridable stop() method to HotwordEngine Class
- Add stop implementation to precise shutting down the runner
- Call wakeword_recognizer.stop() before reloading the listener configuration
2018-12-07 13:28:47 +01:00
devs-mycroft e22938cb68 Version bump from 18.8.7 to 18.8.8 2018-12-07 01:55:26 +00:00
devs-mycroft 91fe3b79f8 Version bump from 18.8.6 to 18.8.7 2018-12-06 14:13:45 +00:00
Åke d53cff746a
Merge pull request #1903 from forslund/bugfix/log-config
Handle invalid json when loading log level
2018-12-06 10:40:37 +01:00
Åke Forslund 178319aa68 Handle invalid json when loading log level
Just ignore invalid log files
2018-12-05 22:32:23 +01:00
Åke cb5b9e85bf Handle failing refresh tokens (#1894)
Catch the HTTPError caused by the server returning a 401 status code when an expired refresh code is used to refresh the token.
2018-12-05 14:41:06 -06:00
Michael Nguyen 3bb15bc3c8
Merge pull request #1900 from forslund/feature/common-qa
Common query framework
2018-12-05 14:13:01 -06:00
Åke Forslund f95ff0a2f3 Remove extra except.
except except Exception -> except Exception
2018-12-05 12:36:53 +01:00
Åke 60462d8979
Merge pull request #1899 from MycroftAI/feature/gui
First pass at the GUI infrastructure
2018-12-05 09:23:08 +01:00
Steve Penrod 1e5ff1392f Feedback from code review
Several small changes based on the code review feedback:
* Drop '_' from classes like Enclosure_Mark1
* Adopt Python 3 style for class definitions and don't explicitly list '(object)'
* Slightly better documentation
* Moved MycroftSkill.show_html() to SkillGUI, resulting in code like self.gui.show_page('Weather.qml')
* Renamed SkillGUI.__dict to SkillGUI.__session_data.  This better reflects the
  how values are accessed in the QML.
2018-12-05 01:40:43 -06:00
Åke Forslund 70655bd9b6 Handle missing "enclosure" section in system config
Default to empty dict instead of None if the "enclosure" section is missing
2018-12-05 07:53:35 +01:00
Åke Forslund 7036c19bfc Add posibility to give bonus for visual skills
CQSVisualMatchLevel can be returned and if the device is a mark-2 a bonus will be given to the skill.
2018-12-04 23:47:52 +01:00
Åke Forslund 5b168c753b Add CommonQuerySkill class
Adds support for negotiating best answer for a questions

Currently three levels of confidence are defined

EXACT: If the query could be identified exactly and a response is returned.
    Example: The cockail skill could find a cocktail in the query that exists in
             it's database.

CATEGORY: A category of questions the skill handles could be identified.
    Example: The wiki-data skill can identify that the question is regarding
             A date of birth and finds an answer.

GENERAL: A general question and answer service could parse the question.
    Example: The wolfram alpha skill got a match for "How tall is Abraham
             Lincoln".
2018-12-04 22:58:25 +01:00
danielwine 7ec96b0d07 Add format_hu and update format.py along with tests 2018-12-04 15:09:20 +01:00
Steve Penrod 07bd6ef7af Code cleanup
Fixing PEP8 and such before merging into 'dev' branch.
2018-12-03 17:33:26 -06:00
danielwine 373e9f884f Add Hungarian dialog files 2018-12-01 20:38:43 +01:00
Steve Penrod 54daa84786 Support non-translated resources, QML under 'ui' folder
The QML files are typically not translated like other Mycroft resources,
they have internal translation tools.  And at times there are other
resources that don't need to be translated all the time, for example
color strings like "AliceBlue" which might be used by non-English
speakers.

So now the translation mechanism looks for resource file X as follows:
1) Look for <res_dir>/<lang>/X
2) Look for <res_dir>/X
3) Look for anywhere under locale/<lang>/.../X

And now the show_page() method starts looking for resources under the skill/ui folder.
2018-11-30 16:26:01 -06:00
Steve Penrod 0ff744529b * Add tracking of the active namespaces for the GUI. Currently the namespace list
is kept in order, but old namespaces/skills are never culled.
* The active namespace list is synced on a GUIConnection level
* QML display requests now are sent as a list instead of a single entry, i.e.
  with "gui_urls" instead of "gui_url".  Currently a skill can only send a single
  QML, however.
* Change CLI GUI client to handle "gui_urls" instead of "gui_url"
2018-11-30 03:04:53 -06:00
Åke Forslund 9364b69834 Always use a fresh msm instance
- Use a fresh msm instance to  automatically load the skills_data
- write skills_data.json is now automagic so explicit write isn't needed.
2018-11-29 16:45:31 +01:00
Åke Forslund ec63492628 Add backwards compatibility
Make sure the older version of the install skill will still work. The SettingsManager.load/write_skills_data() will return the version 0 format of the skills_data and the write_skills_data() will convert to the version 1 format before doing the write.
2018-11-29 16:44:58 +01:00
Åke Forslund 8167396eb9 Add skills.json handling through msm
- Lock msm when doing an update
- Add device enpoint for uploading skills.json
- Add configuration value for skill store updates
- Upload skills manifest after update
2018-11-29 16:44:58 +01:00
Kris Gesling 32a3860bce Issue-1877 - fix ordinal followed by one
"Third one" will now return the expected 3 instead of 1.
2018-11-26 09:25:44 +01:00
Steve Penrod 685a729994 Enhance CLI GUI client
The GUI client built-in to the CLI now has these features:
* Activate/deactivate via Ctrl+G
* GUI 'window' shows active page title and all namespace variables
* Add fool-proof primitive draw(x,y, msg) that takes care of clipping, and padding
2018-11-23 09:29:16 -06:00
devs-mycroft 3e6dedbbcc Version bump from 18.8.5 to 18.8.6 2018-11-22 14:34:06 +00:00
Steve Penrod b9fb463727 Fleshing out GUI mechanisms, CLI "GUI"
Further fleshing out of the GUI mechanisms
* Support for data and page from Mycroft -> GUIConnection
* Add a 'reconnecting' event for the messagebus
* Add MycroftSkill.show_url()
* Plumb MycroftSkill.gui into the messagebus
* Implement MycroftSkill.gui dictionary

CLI extensions for the GUI:
* Can now act as a simple GUIConnection
* Minor revamp of messagebus connection, provides kinder handling when
  messagebus isn't found or ready.
* BUGFIX: An empty filter would filter ALL messages
* BUGFIX: Input wider than the screen would cause a crash
* BUGFIX: "filter" or "find" with no param would filer "filter" or find "find"
2018-11-21 02:05:28 -06:00
JarbasAI 29310363d7 fix converse (#1884)
- Fix Exception on non-existing instances crashes the handle_converse_request()
- Report error to intent service
- Cleanup of converse related code.
2018-11-20 14:31:49 +01:00
Michael Nguyen e19062cccd
Merge pull request #1871 from forslund/bugfix/audioservice-stop
Bugfix CPS Starting audio
2018-11-19 14:54:54 -06:00
Jaime Muñoz Martín 70cb8251d7 Catalan translation added (#1881)
Add catalan
2018-11-19 20:43:26 +01:00
JarbasAI 60d2905678 feature/extract multiple numbers from text (#1867)
Add extract_numbers() function

The function extracts all numbers from the input string and returns them as a list.
2018-11-19 12:39:59 +01:00
Åke 4e35604d70
Merge pull request #1870 from JarbasAl/feature/improve_datetime
improve datetime parsing
2018-11-17 09:14:41 +01:00
jarbasal fa2b3007a9 improve datetime parsing with long times and a couple
add support for decades, centuries, millemniums
add support for "within the hour", "in a second/minute",
add support for "a couple time_unit" and "a couple of time_unit"
2018-11-17 09:03:41 +01:00
jarbasal 4e3667e21c Only replace complete words in message remainder
Replace str.replace() with simple regex
2018-11-17 08:35:40 +01:00
Åke Forslund a67a60a8eb Remove bare except 2018-11-16 12:14:09 +01:00
Åke Forslund 986e70ec9b Add docstrings for play_* methods 2018-11-16 12:03:42 +01:00
Åke Forslund bf390bcac9 Fix typos in CommonPlaySkill docstrings 2018-11-16 11:50:48 +01:00
Åke Forslund 8859ff1d3b Don't stop audio right after play start
The common play skill sends a stop message in the CPS_start(), if the play message is sent too close to the stop message it may be executed before the stop message causing playback to immediately stop.

To circumvent this a 1 second stop ignore time is added.
2018-11-15 13:57:17 +01:00
Francis Tyers fad4c71398 Update mycroft.conf (#1869)
Make it clearer how to blacklist skills, e.g. it's the `basename()` of the directory where the skill lives.
2018-11-12 20:23:04 -05:00
devs-mycroft b596b4296d Version bump from 18.8.4 to 18.8.5 2018-11-08 15:46:48 +00:00
Steve Penrod dbd3675156 Fixing a few bugs and adding test code to fire up a weather skill visualization upon GUI connection.
Still very much a work in progress.

For understand and testing, here is the sequence:

STEP 1:  GUI announces itself
* Connect to the main Mycroft messagebus
* Send:  "mycroft.gui.connected" with data { "gui_id": XXX } where XXX is a uniq ID (uuid)

STEP 2:  Mycroft creates GUI socket
* Mycroft extracts the gui_id
* Mycroft prepares a socket and announces its availability on the Mycroft messagebus with:
        self.bus.emit(Message("mycroft.gui.port",
                              {"port": self.GUIs[gui_id].port,
                               "gui_id": gui_id}))

STEP 3:  GUI connects
In python, a very minimal test socket handler on the GUI side would look like this

  from websocket import create_connection

  port = 18181 (from the message above)
     ws = create_connection("ws://0.0.0.0:"+port+"/gui")

  ws.send("Hello, World")
  print("Sent")
  print("Receiving...")
  result =  ws.recv()
  print("Received '%s'" % result)
  ws.close()
2018-11-07 11:06:57 -06:00
jarbasal d9a905c8b1 extract date time improvements 2018-11-07 04:14:21 +00:00
Steve Penrod aede71db86 First pass at support for the Qt/QML display:
Enclosures
* Create a mechanism to instantiate unique Enclosure classes, depending on the platform found in the SYSTEM mycroft.conf
* Implement a generic Enclosure, which support the new GUI protocol
* Implement a Mark 1 Enclosure (expects the serial connection to an Arduino)
* Implement the start of a Mark II enclosure
* Implement a generic enclosure (no screen)
* Implement the GUI announcement and protocol basics

MycroftSkill
* Implement the basis of the GUI-controlling interfaces.  Namely:
  - MycroftSkill.show_text()
  - MycroftSkill.show_image()
  - MycroftSkill.show_html()
  - MycroftSkill.show_page()
  - MycroftSkill.gui to set values for page displays.

Configuration
* Add "gui_websocket" to the mycroft.config.py
2018-11-06 01:48:16 -06:00
Kathy Reid 1de272cf6e
Merge pull request #1861 from MycroftAI/feature/mycroft-skill-member-docs
Update MycroftSkill api documentation
2018-11-06 02:55:59 +11:00
Åke Forslund 18f7bb707f Add docs for some MycroftSkill members of interest 2018-10-29 20:09:26 +01:00
devs-mycroft d394994e45 Version bump from 18.8.3 to 18.8.4 2018-10-26 16:00:25 +00:00
Åke Forslund 25e9eb12c0 Fix issue listing uninstalled skills in skills.json
All skills known by msm was added to the skills.json, this makes sure only local skills are added
2018-10-26 12:59:52 +02:00
Åke a90aa26803
Merge pull request #1859 from MycroftAI/feature/skill_data_upload
Feature/skill data upload
2018-10-26 10:36:43 +02:00
Åke Forslund 7666acea58 Fix updating beta skills
"HEAD" doesn't actually update to latest remote head to make the update work None is needed.
2018-10-25 14:56:48 +02:00
Åke Forslund 9bcddaf69a Upload skill manifest on write
- Convert skills.json format to new representation and upload
- Store skill installation time when installing defaults
2018-10-24 22:11:35 +02:00
Åke cab63efa5a Support detach_skill in padatious_service (#1846)
The registered intents are now stored in a list. When a detach_skill message is received the list is checked for matching intents and the intents are removed
2018-10-24 10:26:06 -05:00
Åke Forslund a5545bcb03 Add skills json upload endpoint to api 2018-10-24 13:28:33 +02:00
Åke Forslund b1f2ff27a0 make CPS_Start not override utterance parameter
If an utterance is provided already the method shall not try to override it with a stored utterance.
2018-10-23 18:31:19 +02:00
Åke Forslund 6dcb6a4290 Handle utterances set to None in play()
play would happily send on None to the audioservice even though it's not a proper sentence. This will handle None and default it to an empty string.
2018-10-23 18:21:10 +02:00
Åke 0f5c851fd9 Add support for comment lines in dialog files (#1847)
Only lines not starting with '#' will be loaded.
2018-10-15 13:35:24 -05:00
devs-mycroft fed27e0905 Version bump from 18.8.2 to 18.8.3 2018-10-11 11:48:22 +00:00
Åke 792a70ebeb
Merge pull request #1843 from MycroftAI/feature/commonplay
Add CommonPlaySkill, unifying search and control
2018-10-11 07:44:33 +02:00
Steve Penrod 2de0859bfc Updated based on review feedback
* Renamed methods (removed odd double-underscore)
* Change CPS_play() to take variable arguments
2018-10-10 16:31:49 -05:00
mpolidori a43a748f97 Change regex string to raw string (#1845) 2018-10-10 12:23:59 -05:00
Michael Nguyen 6289bb5b50
Merge pull request #1835 from forslund/refactor/skills-core
Cleanup of core.py
2018-10-10 11:08:37 -05:00
Åke db3374811d
Merge pull request #1840 from MycroftAI/feautre/fallback_tts
fall back tts function for connection errors
2018-10-10 17:25:34 +02:00
Åke 612f734154 Add module specific lang option to GoogleCloudStt (#1842) 2018-10-10 03:05:05 -05:00
Steve Penrod 4ca6c09d64 Quiet automated tests 2018-10-10 03:02:20 -05:00
Steve Penrod 69cc1b9283 Add CommonPlaySkill, unifying search and control
The CommonPlaySkill base class provides an easy base class for any
skill wishing to use the "Common Play" framework.  This allows multiple
skills to jointly handle requests such as "play Janet Joplin",
"play my Sled Zepplin playlist", "play NPS news" or "play Strump's
speech to the UN".  Previously the "wildcard" intents needed to handle
this were basically impossible -- only one skill got a shot at handling
the request.  Now several skills to search their service to see if they
have anything that can service the request.  The service with which
reports the highest confidence gets invoked.

The CommonPlaySkill makes it easy to implement this.  Simply derive a
skill from CommonPlaySkill (instead of MycroftSkill) and override
the two required methods CPS__match_query_phrase() and CPS__start().
The skill can then use self.CPS__play(url) to begin playback, or invoke
a unique player to interact with a custom service.
2018-10-09 21:02:29 -05:00
Åke d1298744f1
Merge pull request #1831 from silvia-odwyer/language-error-checking
Language error checking
2018-10-09 17:30:41 +02:00
Åke Forslund 3682391960 Fix final pep8 issues 2018-10-09 16:36:15 +02:00
Silvia O'Dwyer 45eadaab49 Warnings for unsupported languages are now logged. 2018-10-09 16:15:57 +02:00
Åke 4f84ff6a62
Merge pull request #1841 from nielstron/feature/issue-1718
Pronounce large numbers, Bugfix/ issue #1718
2018-10-09 15:57:03 +02:00
Niels Mündler 1b16b4dbaf Include problematic input from #1718 as test
Fix trillion being saved with wrong number (10e10 instead of 10e12)

==== Fixed Issues ====
1718

====  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.
2018-10-09 13:18:13 +02:00
Åke Forslund 260f54a386 Move config location definitions to separate file 2018-10-09 11:38:10 +02:00
jarbasal f262bd6f77 Read log level from both user and system config
Resolves issue #1728
2018-10-09 11:37:56 +02:00
Niels Mündler 7c9ae548da Fix pronouncing of fairly large numbers and simplify terms
==== Fixed Issues ====

====  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.
2018-10-09 01:12:03 +02:00
Michael Nguyen 9228367678 catch more exceptions 2018-10-08 17:14:43 -05:00
Niels Mündler a01f11f30a Fix large numbers in short and long scale, include tests 2018-10-09 00:08:14 +02:00
Michael Nguyen b22e9d975d fall back tts function for connection errors 2018-10-08 16:54:22 -05:00
Niels Mündler 0f8c6d118d Simplify script, remove redundancies 2018-10-08 23:43:51 +02:00
Åke 83e1ed1d3c
Merge pull request #1815 from JarbasAl/feature/cross_context
feature: allow adapt context across skills
2018-10-08 22:57:04 +02:00
Åke Forslund b761f02dfb Make ContextManager handle cross intent context
This makes a cross context call be treated as one level when calculating the probability. this makes previous contexes not be completely invalidated when a cross context call is sent.
2018-10-08 14:17:52 +02:00
Åke Forslund cce610b57e use nonlocal in get_scheduled_event_status() 2018-10-07 08:56:26 +02:00
Åke Forslund c06a4711a5 Minor restructurings
The most notable things:
- Use the new wait flag when calling speak
- Fix except without defined exception
2018-10-07 08:56:07 +02:00
Åke Forslund bd76379e5c Improve readability of get_handler_name() 2018-10-07 08:55:58 +02:00
Åke Forslund edaa2cb0af Make load_skill slightly more compact 2018-10-07 08:55:49 +02:00
Åke Forslund b163944437 Move trace formatting to separate function
The new simple_trace() function can now generate a simplified stack trace instead of doing it inline in the MycroftSkill class
2018-10-06 21:41:32 +02:00
Åke 5ea6e69f59 Reorganizing to make button press more responsive (#1830)
The delay while loading files have caused the Mark-1 Button to respond very slowly. This moves the sleep out of the loading section and is handled by the token refresh instead.
2018-10-02 21:20:26 -05:00
Åke 9f4a3c264d Make the combo lock handle multiple users (#1828)
* Make the combo lock handle multiple users

On the Mark-1 the locking would fail since the first time the lock is
accessed the process is run under root (script checking the enclosure
version). This caused the locking to fail since the normal mycroft
processes got an access error (lock-file owned by root)

This change creates lock-files and sets the permissions to 0o777
if the file doesn't exist so it's accessible for all users

Also added an Apache license header
2018-10-01 14:42:21 -05:00
Steve Penrod 0d64e78d0c Add protection for naive skill authors (#1825)
* Add protection for naive skill authors

It is fairly common for new skill authors to attempt actions in the __init__()
method which are not legal yet, as the Skill has not been fully connected to
the Mycroft system.  This adds an @property protection layer for the two most common
issues:
* Accessing MycroftSkill.bus
* Accessing MycroftSkill.enclosure

Now those are properties instead of variables and provide appropriate warnings
when used before they exist.

Also enhancing the handling of error logs in the CLI to highlight problems such
as this:
* Color "- ERROR -" log messages in red
* Retaining leading characters from log messages, improving readability in formatted messages
2018-10-01 21:41:48 +02:00
Michael Nguyen b9c4f2d10e
Merge pull request #1818 from MycroftAI/feature/mimic2-phoenetic-spelling
Use the phonetic_spellings.txt in Mimic2
2018-10-01 12:30:30 -05:00
Steve Penrod edb126ca44 Fixed typo and updated comments on schedule_event 2018-10-01 12:29:28 +02:00
Steve Penrod 1694fb716b Fix date format for today/tomorrow/yesterday
The test for today/tomorrow/yesterday was only looking at the day,
not the month and year.  So on July 14, 2018 it would claim that
the date June 14 2018 and July 14 2020 are all "today".

Now the full date is used in the comparison
2018-10-01 12:28:50 +02:00
Steve Penrod 2efe3eb9ef Fix Ctrl+C and Ctrl+X in CLI (#1826)
* Fix Ctrl+C and Ctrl+X in CLI

There were several quirks in the shutdown of the CLI client:
* Consumed Ctrl+C wasn't being handled cleanly
* main() got called twice, requiring two Ctrl+Cs to exit
2018-09-30 11:14:40 +02:00
Åke 62aa41ce2d Load identity if no refresh token exists (#1821)
This means that no refresh will occur if a refresh isn't possible and
the credentials will be loaded from disk if the process hasn't done so
once.
2018-09-28 12:26:31 -05:00
Steve Penrod 6181fe1484 Reduce much of the noise in the logs (#1819)
This eliminates a lot of the noise in the log files.  Later I'll add features in the CLI to
assist watching the messagebus messages rather than writing them all to logs.

Also corrected some language and formatting in settings.py docstrings.
2018-09-28 12:48:34 +02:00
Åke a3fb64af47 Bugfix/identity lock (#1820)
Description
Fix issues with identity-locking.

How to test
Remove identity file, pair device and check that mycroft can answer questions such as what is the weather and how tall is abraham lincon.
2018-09-28 03:26:04 -05:00
Åke 506d7ed843 Add locking when accessing the IdentityManager (#1801)
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.
2018-09-28 01:26:33 -05:00