add Buffer.get_all
This commit is contained in:
parent
2139c99562
commit
40a459a83c
1 changed files with 8 additions and 0 deletions
|
@ -47,6 +47,14 @@ class Buffer(object):
|
||||||
continue
|
continue
|
||||||
return line
|
return line
|
||||||
return None
|
return None
|
||||||
|
def get_all(self, for_user: typing.Optional[str]=None):
|
||||||
|
if not for_user == None:
|
||||||
|
for line in self._lines:
|
||||||
|
if self.server.irc_lower(line.sender) == for_user:
|
||||||
|
yield line
|
||||||
|
else:
|
||||||
|
for line in self._lines:
|
||||||
|
yield line
|
||||||
def find(self, pattern: typing.Union[str, typing.Pattern[str]], **kwargs
|
def find(self, pattern: typing.Union[str, typing.Pattern[str]], **kwargs
|
||||||
) -> typing.Optional[BufferLineMatch]:
|
) -> typing.Optional[BufferLineMatch]:
|
||||||
from_self = kwargs.get("from_self", True)
|
from_self = kwargs.get("from_self", True)
|
||||||
|
|
Loading…
Reference in a new issue