From fca6adbec9407d6b79c2ea0b83ca1e42d8f6cf44 Mon Sep 17 00:00:00 2001 From: tronikos Date: Fri, 30 Dec 2022 07:03:05 -0800 Subject: [PATCH] Return html_response only if display is True --- pyproject.toml | 2 +- src/gassist_text/textinput.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 376342d..0be5859 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gassist-text" -version = "0.0.6" +version = "0.0.7" authors = [ { name="tronikos", email="tronikos@gmail.com" }, ] diff --git a/src/gassist_text/textinput.py b/src/gassist_text/textinput.py index 867960c..431348a 100644 --- a/src/gassist_text/textinput.py +++ b/src/gassist_text/textinput.py @@ -117,8 +117,9 @@ def iter_assist_requests(): self.deadline): assistant_helpers.log_assist_response_without_audio(resp) if resp.screen_out.data: - html_response = resp.screen_out.data - soup = BeautifulSoup(html_response, "html.parser") + if self.display: + html_response = resp.screen_out.data + soup = BeautifulSoup(resp.screen_out.data, "html.parser") divs = soup.find_all("div", class_="show_text_content") text_response = '\n'.join(map(lambda div : div.text, divs)) if resp.dialog_state_out.conversation_state: