summaryrefslogtreecommitdiff
path: root/alot/widgets/search.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-01-20 16:01:25 -0800
committerDylan Baker <dylan@pnwbakers.com>2017-01-27 10:34:45 -0800
commitbef724a5d142a1ca06476d56015a6c6bcdf89f1b (patch)
treec8f650a4d68ed47fef3a4cf758fa7b6c9919ef4a /alot/widgets/search.py
parent7fd9b50a7f43821c6931e4f19efc37c138d77837 (diff)
Replace cmp with rich comparisons
This is both a performance issue (since cmp is slower than rich comparisons), and a python3 issue since cmp (and __cmp__) are gone in python 3.
Diffstat (limited to 'alot/widgets/search.py')
-rw-r--r--alot/widgets/search.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/alot/widgets/search.py b/alot/widgets/search.py
index a0f23b5e..32a078c7 100644
--- a/alot/widgets/search.py
+++ b/alot/widgets/search.py
@@ -10,7 +10,6 @@ import urwid
from ..settings import settings
from ..helper import shorten_author_string
-from ..helper import tag_cmp
from .utils import AttrFlipWidget
from .globals import TagWidget
@@ -116,10 +115,8 @@ class ThreadlineWidget(urwid.AttrMap):
if self.thread:
fallback_normal = struct[name]['normal']
fallback_focus = struct[name]['focus']
- tag_widgets = [TagWidget(t, fallback_normal, fallback_focus)
- for t in self.thread.get_tags()]
- tag_widgets.sort(tag_cmp,
- lambda tag_widget: tag_widget.translated)
+ tag_widgets = sorted(TagWidget(t, fallback_normal, fallback_focus)
+ for t in self.thread.get_tags())
else:
tag_widgets = []
cols = []