Config.parse_config()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 5
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
1
"""Configuration module."""
2
3 1
import os
4 1
import json
5 1
import logging
6 1
from ppp_libmodule.config import Config as BaseConfig
7 1
from ppp_libmodule.exceptions import InvalidConfig
8
9
10 1
class Config(BaseConfig):
11 1
    __slots__ = ('corenlp_servers',
12
            'memcached_servers', 'memcached_timeout', 'memcached_salt')
13 1
    config_path_variable = 'PPP_QUESTIONPARSING_GRAMMATICAL_CONFIG'
14 1
    def parse_config(self, data):
15 1
        self.corenlp_servers = data['corenlp_servers']
16 1
        self.memcached_servers = data['memcached']['servers']
17 1
        self.memcached_timeout = data['memcached']['timeout']
18
        self.memcached_salt = data['memcached']['salt']
19