summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorLucas Hoffmann <l-m-h@web.de>2017-03-01 09:11:59 +0100
committerLucas Hoffmann <l-m-h@web.de>2017-03-01 09:11:59 +0100
commit720d386efc57b5664ffb43aadf3f541434e0ae18 (patch)
tree110e1d36e05547bc42cbc9f5b043f2b5a0b28db9 /alot
parentf3aaa5a3cdecf2e900594240ded7a73fe2b556ea (diff)
Revert "Turn alot.walker.PipeWalker.focus into a property"
This reverts commit 237499e631741dbb3837e5ef99cc66f842e8a92e.
Diffstat (limited to 'alot')
-rw-r--r--alot/buffers.py2
-rw-r--r--alot/walker.py18
2 files changed, 9 insertions, 11 deletions
diff --git a/alot/buffers.py b/alot/buffers.py
index 600bda16..c0725bb0 100644
--- a/alot/buffers.py
+++ b/alot/buffers.py
@@ -282,7 +282,7 @@ class SearchBuffer(Buffer):
returns curently focussed :class:`alot.widgets.ThreadlineWidget`
from the result list.
"""
- threadlinewidget, _ = self.threadlist.focus
+ threadlinewidget, _ = self.threadlist.get_focus()
return threadlinewidget
def get_selected_thread(self):
diff --git a/alot/walker.py b/alot/walker.py
index a26b2926..4f9efb70 100644
--- a/alot/walker.py
+++ b/alot/walker.py
@@ -20,20 +20,18 @@ class PipeWalker(urwid.ListWalker):
self.kwargs = kwargs
self.containerclass = containerclass
self.lines = []
- self._focus = 0
+ self.focus = 0
self.empty = False
self.direction = -1 if reverse else 1
def __contains__(self, name):
return self.lines.__contains__(name)
- @property
- def focus(self):
- return self._get_at_pos(self._focus)
+ def get_focus(self):
+ return self._get_at_pos(self.focus)
- @focus.setter
- def focus(self, value):
- self._focus = value
+ def set_focus(self, focus):
+ self.focus = focus
self._modified()
def get_next(self, start_from):
@@ -43,9 +41,9 @@ class PipeWalker(urwid.ListWalker):
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
+ 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: