Clear screen implemented
This commit is contained in:
parent
a5b50da2c8
commit
e3eae2eac6
9
loggy.py
9
loggy.py
@ -59,7 +59,10 @@ class LogViewerApp(App):
|
|||||||
"""Eine Textual-App zum Anzeigen und Filtern von Python-Logs."""
|
"""Eine Textual-App zum Anzeigen und Filtern von Python-Logs."""
|
||||||
|
|
||||||
CSS_PATH = "style.tcss"
|
CSS_PATH = "style.tcss"
|
||||||
BINDINGS = [("q", "quit", "Quit")]
|
BINDINGS = [
|
||||||
|
("q", "quit", "Quit"),
|
||||||
|
("c", "clear_screen", "Clear")
|
||||||
|
]
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@ -127,6 +130,10 @@ class LogViewerApp(App):
|
|||||||
|
|
||||||
self.log_display.write(message)
|
self.log_display.write(message)
|
||||||
|
|
||||||
|
def action_clear_screen(self):
|
||||||
|
self.all_logs = []
|
||||||
|
self._update_display()
|
||||||
|
|
||||||
def _update_display(self):
|
def _update_display(self):
|
||||||
"""Löscht die Anzeige und rendert alle Logs basierend auf den aktuellen Filtern neu."""
|
"""Löscht die Anzeige und rendert alle Logs basierend auf den aktuellen Filtern neu."""
|
||||||
self.log_display.clear()
|
self.log_display.clear()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user