| 1 | ''' |
| 2 | imap-mark-seen.py - Tool to mark all e-mails as seen |
| 3 | |
| 4 | Copyright (c) 2012 Intra2net AG |
| 5 | Author: Plamen Dimitrov and Thomas Jarosch |
| 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""" |
| 23 | self.detected_problems += 1 |