First pylint validation
[imap-restore-mail] / warnings_handler.py
CommitLineData
5737b10e
PD
1'''
2restore-mail-inject.py - Tool to inject mails via IMAP
3
4Copyright (c) 2012 Intra2net AG
5'''
6import logging
7
8class WarningsHandler(logging.Handler):
9 """This class iterates through the e-mail files."""
10
11 # class attributes
12 detected_problems = None
13
14 def __init__(self):
15 """Initialize a handler to count number of warnings."""
16 logging.Handler.__init__(self)
17 self.detected_problems = 0
18
19 def emit(self, record):
20 """Increase number of warnings found"""
21 self.detected_problems += 1
22