From 116dbe9222dd3b118d14dfd2c834d2ee1a97f941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Forment?= Date: Wed, 31 Jul 2024 17:43:10 +0200 Subject: [PATCH] Fixing bug with Pat flooding the terminal --- sardine_core/run.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sardine_core/run.py b/sardine_core/run.py index bd990afd..27e509f3 100644 --- a/sardine_core/run.py +++ b/sardine_core/run.py @@ -407,7 +407,7 @@ def panic(*runners: AsyncRunner) -> None: def Pat( - pattern: str, i: int = 0, div: int = 1, rate: int = 1, as_text: bool = False + pattern: str, i: int = 0, div: int = 1, rate: int = 1 ) -> Any: """ General purpose pattern interface. This function can be used to summon the global @@ -426,15 +426,7 @@ def Pat( Returns: int: The ith element from the resulting pattern """ - result = bowl.parser.parse(pattern) - if print: - pattern = [] - for iterator in range(i): - pattern.append(Sender.pattern_element(result, iterator, div, rate)) - print(pattern) - return pattern - else: - return Sender.pattern_element(result, i, div, rate) + return Sender.pattern_element(bowl.parser.parse(pattern), i, div, rate) class Delay: