

def spider_closed(self, spider):
    spider_stats = self.stats.get_stats(spider)
    body = 'Global stats\n\n'
    body += '\n'.join((('%-50s : %s' % i) for i in self.stats.get_stats().items()))
    body += ('\n\n%s stats\n\n' % spider.name)
    body += '\n'.join((('%-50s : %s' % i) for i in spider_stats.items()))
    return self.mail.send(self.recipients, ('Scrapy stats for: %s' % spider.name), body)

dataset/ETHPy150Open scrapy/scrapy/scrapy/extensions/statsmailer.py StatsMailer.spider_closed/original