Commit | Line | Data |
---|---|---|
87758662 | 1 | ''' |
7c7f439f | 2 | imap-mark-seen.py - Tool to mark all e-mails as seen |
87758662 PD |
3 | |
4 | Copyright (c) 2012 Intra2net AG | |
5 | Author: Plamen Dimitrov and Thomas Jarosch | |
87758662 PD |
6 | ''' |
7 | import logging | |
8 | ||
9 | class WarningsHandler(logging.Handler): | |
10 | """This class iterates through the e-mail files.""" | |
11 | ||
12 | # class attributes | |
13 | detected_problems = None | |
14 | ||
15 | def __init__(self): | |
16 | """Initialize a handler to count number of warnings.""" | |
17 | ||
18 | logging.Handler.__init__(self) | |
19 | self.detected_problems = 0 | |
20 | ||
21 | def emit(self, record): | |
22 | """Increase number of warnings found""" | |
87758662 | 23 | self.detected_problems += 1 |