If a Skill does not have a valid dialog
or locale
directory, and attempts to speak some dialog using strings within the Skill eg
self.speak_dialog('say something')
then the method fails as the dialog_renderer
has not been assigned:
File "/home/kris/mycroft-core/mycroft/skills/mycroft_skill/mycroft_skill.py", line 1102, in speak_dialog
self.speak(self.dialog_renderer.render(key, data),
AttributeError: 'NoneType' object has no attribute 'render'
Creating an empty dialog/en-us/
directory resolves the issue.
As the Skill author is not using a dialog string, the expectation is that the directory is not required.
Or could provide a more descriptive error message for this case, as it may also be that they have incorrectly spelled the directory name eg local/en_us
Easiest would be handling this in the MycroftSkill.speak_dialog()
method making it something like
if self.dialog_renderer:
data = data or {}
self.speak(self.dialog_renderer.render(key, data),
expect_response, wait, meta={'dialog': key, 'data': data})
else:
self.log.warning('Dialog renderer doesn't exist, does the locale/dialog folder exists?')
self.speak(key, expected_response, wait, {})
I'll get it if no one minds
Most helpful comment
Easiest would be handling this in the
MycroftSkill.speak_dialog()
method making it something like