Verified Commit 5032905f authored by Maxime Buquet's avatar Maxime Buquet

plugins/lastlog: Display time and nickname

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <>
parent 4fa30ca7
......@@ -12,16 +12,23 @@
import re
from typing import Optional
from datetime import datetime
from poezio.plugin import BasePlugin
from poezio import tabs
from poezio.text_buffer import Message, TextBuffer
def add_line(text_buffer: TextBuffer, text: str) -> None:
def add_line(
text_buffer: TextBuffer,
text: str,
datetime: Optional[datetime] = None,
) -> None:
"""Adds a textual entry in the TextBuffer"""
None, # Time
datetime, # Time
None, # Nickname
None, # Nick Color
False, # History
......@@ -58,7 +65,7 @@ class Plugin(BasePlugin):
if message.nickname is not None and \ is not None:
add_line(text_buffer, "%s" % (message.txt))
add_line(text_buffer, "%s> %s" % (message.nickname, message.txt), message.time)
add_line(text_buffer, "End of Lastlog")
self.api.current_tab().text_win.pos = 0
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment