Skip to content

Commit

Permalink
searching/filtering for logs
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasTomecek committed Jun 29, 2016
1 parent 887e438 commit 3aaf08c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sen/tui/widgets/list/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def _search(self, reverse_search=False):
if hasattr(obj, "matches_search"):
condition = obj.matches_search(self.search_string)
else:
condition = self.search_string in obj.original_widget.text
if hasattr(obj, "original_widget"):
text = obj.original_widget.text
else:
text = obj.text
condition = self.search_string in text
if condition:
self.set_focus(pos)
self.reload_widget()
Expand All @@ -81,7 +85,11 @@ def filter(self, s, widgets_to_filter=None):
if hasattr(obj, "matches_search"):
condition = obj.matches_search(s)
else:
condition = s in obj.original_widget.text
if hasattr(obj, "original_widget"):
text = obj.original_widget.text
else:
text = obj.text
condition = s in text

if condition:
widgets.append(obj)
Expand Down

0 comments on commit 3aaf08c

Please sign in to comment.