def _get_header_widget(self): """creates/returns the widget that displays the mail header""" if not self.headerw: displayed = config.getstringlist('general', 'displayed_headers') cols = [MessageHeaderWidget(self.message.get_email(), displayed)] bc = list() if self.depth: cols.insert(0, self._get_spacer(self.bars_at[1:])) bc.append(0) self.headerw = urwid.Columns(cols, box_columns=bc) return self.headerw
def __init__(self, message, even=False, folded=True, depth=0, bars_at=[]): """ :param message: the message to display :type message: alot.db.Message :param even: use messagesummary_even theme for summary :type even: bool :param folded: fold message initially :type folded: bool :param depth: number of characters to shift content to the right :type depth: int :param bars_at: defines for each column of the indentation whether to use a vertical bar instead of a space. :type bars_at: list(bool) """ self.message = message self.mail = self.message.get_email() self.depth = depth self.bars_at = bars_at self.even = even self.folded = folded # build the summary line, header and body will be created on demand self.sumline = self._build_sum_line() self.headerw = None self.attachmentw = None self.bodyw = None # set available and to be displayed headers self.all_headers = self.mail.keys() displayed = config.getstringlist('general', 'displayed_headers') self.filtered_headers = [k for k in displayed if k in self.mail] self.displayed_headers = self.filtered_headers self.rebuild() # this will build self.pile urwid.WidgetWrap.__init__(self, self.pile)