code: def build_statusbar(self):
          
          info = {}
          cb = self.current_buffer
          btype = None
  
          if cb is not None:
              info = cb.get_info()
              btype = cb.modename
              info['buffer_no'] = self.buffers.index(cb)
              info['buffer_type'] = btype
          info['total_messages'] = self.dbman.count_messages('*')
          info['pending_writes'] = len(self.dbman.writequeue)
          info['input_queue'] = ' '.join(self.input_queue)
  
          lefttxt = righttxt = u''
          if cb is not None:
              lefttxt, righttxt = settings.get(btype + '_statusbar', (u'', u''))
              lefttxt = string_decode(lefttxt, 'UTF-8')
              lefttxt = lefttxt.format(**info)
              righttxt = string_decode(righttxt, 'UTF-8')
              righttxt = righttxt.format(**info)
  
          footerleft = urwid.Text(lefttxt, align='left')
          pending_writes = len(self.dbman.writequeue)
          if pending_writes > 0:
              righttxt = ('|' * pending_writes) + ' ' + righttxt
          footerright = urwid.Text(righttxt, align='right')
          columns = urwid.Columns([
              footerleft,
              ('pack', footerright)])
          footer_att = settings.get_theming_attribute('global', 'footer')
          return urwid.AttrMap(columns, footer_att)
docs: construct and return statusbar widget