I was told I could ask this here. Please forgive me if I’m not suppose to.
I am having an issue where I want to tell the user if an option is missing (like the username)… but the username is set in ```settings.json.
Line concerned: https://gitlab.com/HypeWolf/mycroft-nextcloud/blob/master/init.py#L89
I have a function called in init:
def caldavConnect(self):
username = self.settings.get(“username”)
password = self.settings.get(“password”)
protocol = self.settings.get(“protocol”)
url = self.settings.get(“url”)
LOGGER.info(username)
# FIXME If a parameter is missing, the skill should warn the user and stop.
if not username:
LOGGER.error("No username in configuration.")
self.speak_dialog('err.conf.username')
return False
elif not password:
LOGGER.error("No password in configuration.")
self.speak_dialog('err.conf.password')
return False
elif not url:
self.speak_dialog('err.conf.url')
return False
And the stack:
16:14:33.099 - mycroft.skills.core:load_skill:169 - ERROR - Failed to load skill: nextcloud-skill
Traceback (most recent call last):
File “/media/DarkHawk/srv/Github/mycroft-core/mycroft/skills/core.py”, line 135, in load_skill
skill = skill_module.create_skill()
File “/opt/mycroft/skills/nextcloud-skill/init.py”, line 194, in create_skill
return NextcloudSkill()
File “/opt/mycroft/skills/nextcloud-skill/init.py”, line 50, in init
self.caldav_ = self.caldavConnect()
File “/opt/mycroft/skills/nextcloud-skill/init.py”, line 89, in caldavConnect
self.speak_dialog(‘err.conf.username’)
File “/media/DarkHawk/srv/Github/mycroft-core/mycroft/skills/core.py”, line 1439, in speak_dialog
self.speak(self.dialog_renderer.render(key, data),
AttributeError: ‘NoneType’ object has no attribute ‘render’