Skip to content

Commit

Permalink
Fixing bug with Pat flooding the terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubobubobubobubo committed Jul 31, 2024
1 parent f5551ce commit 116dbe9
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions sardine_core/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 116dbe9

Please sign in to comment.