def expand(self, pos): """ overload CollapsibleTree.expand method to ensure all parts are present. Initially, only the summary widget is created to avoid reading the messafe file and thus speed up the creation of this object. Once we expand = unfold the message, we need to make sure that body/attachments exist. """ logging.debug("MT expand") if not self._bodytree: self.reassemble() CollapsibleTree.expand(self, pos)
def __init__(self, message, odd=True): """ :param message: Message to display :type message: alot.db.Message :param odd: theme summary widget as if this is an odd line (in the message-pile) :type odd: bool """ self._message = message self._odd = odd self.display_source = False self._summaryw = None self._bodytree = None self._sourcetree = None self.display_all_headers = False self._all_headers_tree = None self._default_headers_tree = None self.display_attachments = True self._attachments = None self._maintree = SimpleTree(self._assemble_structure()) CollapsibleTree.__init__(self, self._maintree)