diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-02-08 13:56:56 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-02-19 16:00:44 +0100 |
commit | d25d788bdcf91f4066ae8e80ef7aebe85213d4d3 (patch) | |
tree | f0b35cfdd0fbeb36af971a6ea640f145771d16aa /alot/db/message.py | |
parent | 48dac1d9089ce2a36c55dc4768b24293d1257a37 (diff) |
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.
Diffstat (limited to 'alot/db/message.py')
-rw-r--r-- | alot/db/message.py | 16 |
1 files changed, 10 insertions, 6 deletions
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: |