From 33e191b9809c45695540401e36abb92366bc0461 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 27 Apr 2020 23:29:09 +0100 Subject: [PATCH] better Nick repr, add Mask repr --- ircrobots/matching/params.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ircrobots/matching/params.py b/ircrobots/matching/params.py index 9cac856..ea19a65 100644 --- a/ircrobots/matching/params.py +++ b/ircrobots/matching/params.py @@ -67,10 +67,8 @@ class Nick(IMatchResponseHostmask): def __init__(self, nickname: str): self._nickname = nickname self._folded: Optional[str] = None - def __repr__(self) -> str: - mask = f"{self._nickname}!*@*" - return f"Hostmask({mask!r})" + return f"Nick({self._nickname!r})" def match(self, server: IServer, hostmask: Hostmask): if self._folded is None: self._folded = server.casefold(self._nickname) @@ -80,6 +78,8 @@ class Mask(IMatchResponseHostmask): def __init__(self, mask: str): self._mask = mask self._compiled = Optional[Glob] + def __repr__(self) -> str: + return f"Mask({self._mask!r})" def match(self, server: IServer, hostmask: Hostmask): if self._compiled is None: self._compiled = glob_compile(self._mask)