From 0b303eebc6b4f02d0113084ed91fef9a044c509a Mon Sep 17 00:00:00 2001 From: Erwan LE BESCOND Date: Sat, 6 Mar 2021 12:46:46 +0100 Subject: [PATCH] fix #23 with_text method is useless Signed-off-by: Erwan LE BESCOND --- tock/models.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tock/models.py b/tock/models.py index 5f5bc19..48786f3 100644 --- a/tock/models.py +++ b/tock/models.py @@ -216,25 +216,13 @@ def __init__(self, text: str): self.__suggestions = [] self.__delay = 0 - def with_text(self, text: Any): - if isinstance(text, I18nText): - self.__text = text - else: - self.__text = I18nText( - text=text, - args=[], - to_be_translated=True, - length=len(text) - ) - return self - def add_suggestion(self, title: str): self.__suggestions.append(Suggestion( title=I18nText( text=title, args=[], to_be_translated=True, - length=len(self.__text) + length=len(title) ) )) return self