code: def build_text_part(name, thread, struct):
      
  
      part_w = None
      width = None
  
      # extract min and max allowed width from theme
      minw = 0
      maxw = None
      width_tuple = struct['width']
      if width_tuple is not None:
          if width_tuple[0] == 'fit':
              minw, maxw = width_tuple[1:]
  
      content = prepare_string(name, thread, maxw)
  
      # pad content if not long enough
      if minw:
          alignment = struct['alignment']
          if alignment == 'left':
              content = content.ljust(minw)
          elif alignment == 'center':
              content = content.center(minw)
          else:
              content = content.rjust(minw)
  
      # define width and part_w
      text = urwid.Text(content, wrap='clip')
      width = text.pack()[0]
      part_w = AttrFlipWidget(text, struct)
  
      return width, part_w
docs: create an urwid.Text widget (wrapped in approproate Attributes)
      to display a plain text parts in a threadline.
      create an urwid.Columns widget (wrapped in approproate Attributes)
      to display a list of tag strings, as part of a threadline.
  
      :param name: id of part to build
      :type name: str
      :param thread: the thread to get local info for
      :type thread: :class:`alot.db.thread.Thread`
      :param struct: theming attributes for this part, as provided by
                     :class:`alot.settings.theme.Theme.get_threadline_theming`
      :type struct: dict
      :return: overall width (in characters) and a widget.
      :rtype: tuple[int, AttrFliwWidget]