Completed
Push — master ( 025da3...410210 )
by Oleksandr
01:36
created

clean()   A

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
cc 1
dl 0
loc 10
ccs 2
cts 2
cp 1
crap 1
rs 9.4286
1
# -*- coding: utf-8 -*-
2
3 1
from . import ValuesParser
4
5
6 1
class RespawnTimeParser(ValuesParser):
7
    """
8
    Parses ``RespawnTime`` section.
9
    View :ref:`detailed description <respawn-time-section>`.
10
    """
11
12 1
    def check_section_name(self, section_name):
13 1
        return section_name == "RespawnTime"
14
15 1
    def clean(self):
16 1
        return {
17
            'respawn_time': {
18
                'ships': {
19
                    'big': int(self.data['Bigship']),
20
                    'small': int(self.data['Ship']),
21
                },
22
                'balloons': int(self.data['Aeroanchored']),
23
                'artillery': int(self.data['Artillery']),
24
                'searchlights': int(self.data['Searchlight']),
25
            },
26
        }
27