From ffb02915a33b722e8ce078ed062799320b706e42 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 19 Apr 2020 18:31:11 +0200 Subject: buffers/search: drop unused code --- alot/buffers/search.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'alot/buffers') diff --git a/alot/buffers/search.py b/alot/buffers/search.py index 17023c16..d1b3e556 100644 --- a/alot/buffers/search.py +++ b/alot/buffers/search.py @@ -17,14 +17,13 @@ class PipeWalker(urwid.ListWalker): :attr lines: the lines obtained from the pipe :type lines: list(`containerclass`) """ - def __init__(self, pipe, containerclass, reverse=False, **kwargs): + def __init__(self, pipe, containerclass, **kwargs): self.pipe = pipe self.kwargs = kwargs self.containerclass = containerclass self.lines = [] self.focus = 0 self.empty = False - self.direction = -1 if reverse else 1 def __len__(self): while not self.empty: @@ -39,20 +38,10 @@ class PipeWalker(urwid.ListWalker): self._modified() def get_next(self, start_from): - return self._get_at_pos(start_from + self.direction) + return self._get_at_pos(start_from + 1) def get_prev(self, start_from): - return self._get_at_pos(start_from - self.direction) - - def remove(self, obj): - next_focus = self.focus % len(self.lines) - if self.focus == len(self.lines) - 1 and self.empty: - next_focus = self.focus - 1 - - self.lines.remove(obj) - if self.lines: - self.set_focus(next_focus) - self._modified() + return self._get_at_pos(start_from - 1) def _get_at_pos(self, pos): if pos < 0: # pos too low @@ -86,9 +75,6 @@ class PipeWalker(urwid.ListWalker): self.empty = True return next_widget - def get_lines(self): - return self.lines - class SearchBuffer(Buffer): """shows a result list of threads for a query""" -- cgit v1.2.3