Add unit testing for the mailbox acls parsing functionality
[imap-restore-mail] / warnings_handler.py
... / ...
CommitLineData
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
17 logging.Handler.__init__(self)
18 self.detected_problems = 0
19
20 def emit(self, record):
21 """Increase number of warnings found"""
22
23 self.detected_problems += 1
24