From 0000b746e970faed60a8edda936bc01eb351d556 Mon Sep 17 00:00:00 2001 From: Denis Shulyaka Date: Sun, 27 Aug 2023 13:50:21 +0300 Subject: [PATCH] handle_adapter_text multiline --- bin/handle_adapter_text.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/handle_adapter_text.py b/bin/handle_adapter_text.py index e0af818..e861612 100755 --- a/bin/handle_adapter_text.py +++ b/bin/handle_adapter_text.py @@ -54,12 +54,19 @@ def main() -> None: handled = False for line in stdout.splitlines(): line = line.strip() - if line: - write_event(Handled(text=line).event()) + if not line: + continue + if not line.endswith(('.', ',', ':', '?', ';')): + line = line + "." + if not handled: + text = line handled = True - break + else: + text = text + " " + line - if not handled: + if handled: + write_event(Handled(text=text).event()) + else: write_event(NotHandled().event()) break