OnLogRecord   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __call__() 0 2 1
A __init__() 0 2 1
A __eq__() 0 3 1
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