Completed
Push — master ( 6469e6...2d0d7d )
by Ryan
58s
created

traceroutedb.Config.__getattr__()   A

Complexity

Conditions 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 5
rs 9.4285
1
2
class Config(dict):
3
4
    def __init__(self):
5
        dict.__init__(self)
6
7
    def __getattr__(self, key):
8
        try:
9
            return self[key]
10
        except KeyError:
11
            raise AttributeError
12
13
    def __setattr__(self, key, value):
14
        self[key] = value
15
16
    def __delattr__(self, key):
17
        del self[key]
18
19
    def __repr__(self):
20
        return '<Config ' + dict.__repr__(self) + '>'
21