From d25d788bdcf91f4066ae8e80ef7aebe85213d4d3 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 8 Feb 2020 13:56:56 +0100 Subject: thread: drop the use of urwidtrees Their API is misdesigned - forces the use of trees for nontree objects and mixes data relationships with display properties. The result is a mess that is hard to understand/maintain/extend. Replace the use of urwidtrees with urwid Pile and ListBox. This temporarily removes tree-style indentation and decorations for thread buffers. That will be reimplemented in following commits. --- alot/db/message.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'alot/db/message.py') diff --git a/alot/db/message.py b/alot/db/message.py index f9e8e37b..62b85788 100644 --- a/alot/db/message.py +++ b/alot/db/message.py @@ -35,24 +35,28 @@ class Message: """value of the Message-Id header (str)""" id = None + """this message's depth in the thread tree""" + depth = None + """A list of replies to this message""" replies = None - def __init__(self, dbman, msg, thread, replies): + def __init__(self, dbman, thread, msg, depth): """ :param dbman: db manager that is used for further lookups :type dbman: alot.db.DBManager - :param msg: the wrapped message - :type msg: notmuch.database.Message :param thread: this messages thread :type thread: :class:`~alot.db.Thread` - :param replies: a list of replies to this message - :type replies alot.db.message.Message + :param msg: the wrapped message + :type msg: notmuch.database.Message + :param depth: depth of this message in the thread tree (0 for toplevel + messages, 1 for their replies etc.) + :type depth int """ self._dbman = dbman self.id = msg.get_message_id() self.thread = thread - self.replies = replies + self.depth = depth try: self.date = datetime.fromtimestamp(msg.get_date()) except ValueError: -- cgit v1.2.3