Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tux/cogs/misc/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from tux.utils.embeds import EmbedCreator
from tux.wrappers import godbolt

ansi_escape = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")
remove_ticks = re.compile(r"\`")
ansi_re = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")
ticks_re = re.compile(r"\`")

compiler_map = {
"hs": "ghc961",
Expand Down Expand Up @@ -57,9 +57,9 @@ def remove_ansi(self, ansi: str) -> str:
The non-ANSI encoded text.
"""

return ansi_escape.sub("", ansi)
return ansi_re.sub("", ansi)

def remove_backticks(self, ticks: str) -> str:
def remove_backticks(self, st: str) -> str:
"""
Removes backticks from the provided string.

Expand All @@ -74,7 +74,7 @@ def remove_backticks(self, ticks: str) -> str:
The string without backticks.
"""

return remove_ticks.sub("", ticks)
return ticks_re.sub("", st)

async def generalized_code_executor(
self,
Expand All @@ -99,7 +99,7 @@ async def generalized_code_executor(

Returns
-------
tuple[str, str, str] | None
tuple[str, str, str]
A tuple containing the filtered output, the first few lines of the output, and the normalized language.
"""

Expand Down