| Total Complexity | 3 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | class OnLogRecord(object): |
||
| 2 | """Trigger a callback when a certain log record is found. |
||
| 3 | |||
| 4 | Parameters |
||
| 5 | ---------- |
||
| 6 | record_name : str |
||
| 7 | The record name to check. |
||
| 8 | |||
| 9 | """ |
||
| 10 | def __init__(self, record_name): |
||
| 11 | self.record_name = record_name |
||
| 12 | |||
| 13 | def __call__(self, log): |
||
| 14 | return bool(log.current_row.get(self.record_name, False)) |
||
| 15 | |||
| 16 | def __eq__(self, other): |
||
| 17 | return (type(other) == type(self) and |
||
| 18 | other.record_name == self.record_name) |
||
| 19 |