diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-02-08 20:54:38 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-02-19 16:00:44 +0100 |
commit | 279b8316341841dd32bdda5a21bb61fed8b9d1ef (patch) | |
tree | d35fd36b6a887351c4c9dd198e337b8148c34423 /alot/db/thread.py | |
parent | d25d788bdcf91f4066ae8e80ef7aebe85213d4d3 (diff) |
thread: implement tree decorations
They were temporarily removed in the previous commit.
Still not working:
- theming for the decorations
- drawing the connector line properly for expanded messages
- configurable indentation
Diffstat (limited to 'alot/db/thread.py')
-rw-r--r-- | alot/db/thread.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/alot/db/thread.py b/alot/db/thread.py index a76997f8..3dc90325 100644 --- a/alot/db/thread.py +++ b/alot/db/thread.py @@ -107,22 +107,23 @@ class Thread: msg_tree = [] msg_list = [] - def thread_tree_walk(nm_msg, depth): + def thread_tree_walk(nm_msg, depth, parent): msg = Message(self._dbman, self, nm_msg, depth) msg_list.append(msg) replies = [] for m in nm_msg.get_replies(): - replies.append(thread_tree_walk(m, depth + 1)) + replies.append(thread_tree_walk(m, depth + 1, msg)) msg.replies = replies + msg.parent = parent msgs[msg.id] = msg return msg for m in nm_thread.get_toplevel_messages(): - msg_tree.append(thread_tree_walk(m, 0)) + msg_tree.append(thread_tree_walk(m, 0, None)) return msgs, msg_tree, msg_list |