Naomi
Naomi copied to clipboard
Slight changes to log and output
Description
Updated logging so python log messages are sent to a log file instead of simply displaying to the screen. The default log file is naomi.log in your "sub" directory (default is ~/.config/naomi).
Created an "output" visualization instead of simply printing to the terminal. Used like:
from naomi import visualizations
visualizations.run_visualization('output', message)
Changelog: naomi/main.py - Use a file for logging naomi/application.py - use a visualization to print messages naomi/conversation.py - include error messages in spoken response naomi/mic.py - use visualization for messages, add time to input/output log. naomi/plugin.py - expand english language contractions before processing utterance. plugins/audioengine/pyaudio-ae/pyaudioengine.py - suppress warnings and errors. plugins/speechhandler/mpdcontrol/mpdcontrol.py - only announce that Naomi is stopping the music if the music is currently playing. plugins/speechhandler/shutdownplugin/shutdown.py - it is no longer necessary to wait for Naomi to finish speaking before shutting down since the asynchronous speaking thread is now daemonized. plugins/speechhandler/stop/stop.py - wait until the first time the "stop" command is received before creating a list of plugins with "stop" methods. plugins/speechhandler/wwis_weather/wwis_weather.py - Don't check for connectivity in the init method. plugins/tti/naomi_tti/naomi_tti.py - send debugging information to log. plugins/vad/webrtc_vad/webrtc_vad.py - set lower limit on stddev. plugins/visualizations/terminal/terminal.py - create an "output" visualization to use for writing messages to the user.
Related Issue
Don't access the internet when initializing speechhandler plugin #359
Motivation and Context
The log file was suggested by Malcolm a while ago, and it seemed like a good way to clean up some of the output on the user's screen, plus provide a good place to look for debugging information. I would like to add a standard way to redirect output from non-python programs to the log, and we might want a way to send output to the screen instead of a log for anyone who is used to Naomi working that way.
Using a visualization to write to the screen instead of simply printing to it should make it easier for someone to override that method and send the output to something else (an lcd screen, or curses window or web interface perhaps?)
How Has This Been Tested?
I've been running with these changes for the last 6 months or so.
Unittests OK:
(Naomi) pi@Naomi:~/Naomi$ python -m unittest discover
...s.....ss.....sssssssss
----------------------------------------------------------------------
Ran 25 tests in 3.585s
OK (skipped=12)
Screenshots (if appropriate):
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [X] My code follows the code style of this project.
- [X] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [X] All new and existing tests passed.
This pull request introduces 1 alert when merging 909e5974e18659a4cb8f9cc658946cc459c98501 into 0ab96bce5528f633b097e4a448307ddd8c5c56d1 - view on LGTM.com
new alerts:
- 1 for Unused import
I am just about to install Naomi on a new device, so I'm going to squash and merge since I'm going to be testing the install process right now.