mirror of
https://github.com/aclist/dztui.git
synced 2026-11-06 10:00:54 +01:00
chore: move log parse action to LogTreeView
This commit is contained in:
1 parent
7b8388376c
commit
39e3bb8d2d
2 files changed
+18
-13
No files matched your search
@@ -81,3 +81,17 @@ class LogTreeView(ContextMixin, TreeView):
|
||||
|
||||
def _on_log_keypress(self, widget: Gtk.Widget, event: Gdk.EventKey) -> None:
|
||||
self.present_menu(widget, event)
|
||||
|
||||
def concatenate_rows(self) -> str | None:
|
||||
# NOTE: LogTreeView uses Gtk.SelectionMode.MULTIPLE
|
||||
final = []
|
||||
model, records = self.get_selection().get_selected_rows()
|
||||
if len(records) < 1:
|
||||
return None
|
||||
for record in records:
|
||||
raw_record = model[record]
|
||||
r = [el for el in raw_record]
|
||||
concat = strings.delimiter.join(r)
|
||||
final.append(concat)
|
||||
text = "\n".join(final)
|
||||
return text
|
||||
Reference in new issue
Block a user