VK: Expand the parentheses from dialog files

pull/3068/head
Åke Forslund 2022-01-26 12:55:36 +01:00
parent 825b3879a5
commit a3fd830cb0
1 changed files with 9 additions and 2 deletions

View File

@ -25,6 +25,7 @@ from behave import given, when, then
from mycroft.messagebus import Message from mycroft.messagebus import Message
from mycroft.audio import wait_while_speaking from mycroft.audio import wait_while_speaking
from mycroft.util.format import expand_options
from test.integrationtests.voight_kampff import (mycroft_responses, then_wait, from test.integrationtests.voight_kampff import (mycroft_responses, then_wait,
then_wait_fail) then_wait_fail)
@ -45,8 +46,14 @@ def load_dialog_file(dialog_path):
"""Load dialog files and get the contents.""" """Load dialog files and get the contents."""
with open(dialog_path) as f: with open(dialog_path) as f:
lines = f.readlines() lines = f.readlines()
return [l.strip().lower() for l in lines
if l.strip() != '' and l.strip()[0] != '#'] # Expand parentheses in lines
expanded_lines = []
for line in lines:
expanded_lines += expand_options(line)
return [line.strip().lower() for line in expanded_lines
if line.strip() != '' and line.strip()[0] != '#']
def load_dialog_list(skill_path, dialog): def load_dialog_list(skill_path, dialog):