Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Commit 29c0119

Browse files
committed
Merge branch 'release/0.3.6'
2 parents f7f3375 + 16bdd2f commit 29c0119

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

flask_assistant/response.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class _Response(object):
88
def __init__(self, speech, display_text=None, is_ssml=False):
99

1010
self._speech = speech
11+
self._display_text = display_text
1112
self._integrations = current_app.config.get("INTEGRATIONS", [])
1213
self._messages = [{"text": {"text": [speech]}}]
1314

@@ -27,7 +28,7 @@ def __init__(self, speech, display_text=None, is_ssml=False):
2728
}
2829

2930
if "ACTIONS_ON_GOOGLE" in self._integrations:
30-
self._integrate_with_actions(speech, display_text, is_ssml)
31+
self._integrate_with_actions(self._speech, self._display_text, is_ssml)
3132

3233
def add_msg(self, speech, display_text=None, is_ssml=False):
3334
self._messages.append({"text": {"text": [speech]}})
@@ -167,11 +168,15 @@ def build_list(self, title=None, items=None):
167168
168169
"""
169170

170-
list_card = _ListSelector(self._speech, title, items)
171+
list_card = _ListSelector(
172+
self._speech, display_text=self._display_text, title=title, items=items
173+
)
171174
return list_card
172175

173176
def build_carousel(self, items=None):
174-
carousel = _CarouselCard(self._speech, items)
177+
carousel = _CarouselCard(
178+
self._speech, display_text=self._display_text, items=items
179+
)
175180
return carousel
176181

177182

@@ -197,8 +202,8 @@ class _CardWithItems(_Response):
197202
Provides the meth:add_item method.
198203
"""
199204

200-
def __init__(self, speech, items=None):
201-
super(_CardWithItems, self).__init__(speech)
205+
def __init__(self, speech, display_text=None, items=None):
206+
super(_CardWithItems, self).__init__(speech, display_text)
202207
self._items = items or list()
203208
self._add_message() # possibly call this later?
204209

@@ -236,10 +241,10 @@ def include_items(self, *item_objects):
236241
class _ListSelector(_CardWithItems):
237242
"""Subclass of basic _Response to provide an instance capable of adding items."""
238243

239-
def __init__(self, speech, title=None, items=None):
244+
def __init__(self, speech, display_text=None, title=None, items=None):
240245
self._title = title
241246

242-
super(_ListSelector, self).__init__(speech, items)
247+
super(_ListSelector, self).__init__(speech, display_text, items)
243248

244249
def _add_message(self):
245250
self._messages.append(
@@ -253,8 +258,8 @@ def _add_message(self):
253258
class _CarouselCard(_ListSelector):
254259
"""Subclass of _CardWithItems used to build Carousel cards."""
255260

256-
def __init__(self, speech, items=None):
257-
super(_CarouselCard, self).__init__(speech, items=items)
261+
def __init__(self, speech, display_text=None, items=None):
262+
super(_CarouselCard, self).__init__(speech, display_text, items=items)
258263

259264
def _add_message(self):
260265
self._messages.append(

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name="Flask-Assistant",
14-
version="0.3.5",
14+
version="0.3.6",
1515
url="https://github.com/treethought/flask-assistant",
1616
license="Apache 2.0",
1717
author="Cam Sweeney",

0 commit comments

Comments
 (0)