Further cleanup

pull/2256/head
Åke Forslund 2019-08-26 15:02:04 +02:00
parent 5e558647e7
commit f081404ce3
1 changed files with 5 additions and 7 deletions

View File

@ -442,7 +442,7 @@ class MycroftSkill:
if cache_key not in self.voc_match_cache: if cache_key not in self.voc_match_cache:
# Check for both skill resources and mycroft-core resources # Check for both skill resources and mycroft-core resources
voc = self.find_resource(voc_filename + '.voc', 'vocab') voc = self.find_resource(voc_filename + '.voc', 'vocab')
if not voc: if not voc: # Check for vocab in mycroft core resources
voc = resolve_resource_file(join('text', lang, voc = resolve_resource_file(join('text', lang,
voc_filename + '.voc')) voc_filename + '.voc'))
@ -598,7 +598,7 @@ class MycroftSkill:
# Not found # Not found
return None return None
def translate_namedvalues(self, name, delim=None): def translate_namedvalues(self, name, delim=','):
"""Load translation dict containing names and values. """Load translation dict containing names and values.
This loads a simple CSV from the 'dialog' folders. This loads a simple CSV from the 'dialog' folders.
@ -613,7 +613,6 @@ class MycroftSkill:
dict: name and value dictionary, or empty dict if load fails dict: name and value dictionary, or empty dict if load fails
""" """
delim = delim or ','
if not name.endswith(".value"): if not name.endswith(".value"):
name += ".value" name += ".value"
@ -936,10 +935,9 @@ class MycroftSkill:
data = {'utterance': utterance, data = {'utterance': utterance,
'expect_response': expect_response} 'expect_response': expect_response}
message = dig_for_message() message = dig_for_message()
if message: m = message.reply("speak", data) if message else Message("speak", data)
self.bus.emit(message.reply("speak", data)) self.bus.emit(m)
else:
self.bus.emit(Message("speak", data))
if wait: if wait:
wait_while_speaking() wait_while_speaking()