docs: def send_report(self, report_parts):
          """
          Publish the report parts to local files. Each report part is a text
          with a title and specific extension. For html and plaintext sending
          the report part is unique, for csv send also the stats and unparsed
          string are plain text and report items are csv texts.
          """
          logger.info('Checking and creating the report directory')
  
          report_parts = sorted(
              filter(lambda x: x.fmt in self.formats, report_parts),
              key=lambda x: self.formats.index(x.fmt)
          )
          workdir = os.path.join(self.pubdir, self.dirname)
          if not os.path.isdir(workdir):
              try: 
                  os.makedirs(workdir)
              except OSError as e:
                  logger.error('Error creating directory "{0}": {0}'.format(workdir, e))
                  return
  
          fmtname = '{0}-{1}-{2}.{3}' if len(report_parts) > 1 else '{0}-{2}.{3}'
  
          for i, text_part in enumerate(filter(lambda x: x.fmt in self.formats, report_parts)):
              filename = fmtname.format(self.filename, i, socket.gethostname(), text_part.ext)
              repfile = os.path.join(workdir, filename)
              logger.info('Dumping the report part %d into %r', i, repfile)
              fh = open(repfile, 'w')
              fh.write(text_part.text)
              fh.close()
              print('Report part saved in: %r' % repfile)
  
          if self.notify:
              logger.info('Creating an email message')
              email_address = self.config.get('main', 'email_address')
              smtp_server = self.config.get('main', 'smtp_server')
              publoc = os.path.join(self.pubroot, self.dirname)
  
              eml = MIMEText('New lograptor report is available at:\r\n{0}'.format(publoc))
              eml['Subject'] = '{0} system events: {1} (report notification)'.format(
                  socket.gethostname(), time.strftime('%c', time.localtime())
              )
              eml['Date'] = formatdate()
              eml['From'] = email_address
              eml['To'] = ', '.join(self.notify)
              eml['X-Mailer'] = u'{0}-{1}'.format(package_name, __version__)
  
              mail_message(smtp_server, eml.as_string(), email_address, self.notify)
              print('Notification mailed to: {0}'.format(','.join(self.notify)))
  
          if self.rawlogs:
              logfilename = '{0}.log'.format(self.filename)
              logfile = os.path.join(workdir, '{0}.gz'.format(logfilename))
  
              logger.info('Gzipping logs and writing them to %r', logfilename)
              outfh = open(logfile, 'w+b')
              do_chunked_gzip(self.rawfh, outfh, logfilename)
              outfh.close()
              print('Gzipped logs saved in: {0}'.format(logfile))
  
          # Purge old reports
          self.prune_old()