Completed
Pull Request — master (#45)
by Oleg
02:04
created

Format.errors()   A

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 1
cts 2
cp 0.5
rs 9.4285
cc 1
crap 1.125
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9 1
import abc
10
11
12 1
class Format:
1 ignored issue
show
Complexity introduced by
This abstract class seems to be used only once.

Abstract classes which are used only once can usually be inlined into the class which already uses this abstract class.

Loading history...
13
    """
14
    Abstract parent class for all formatters for generating output documents in a certain format.
15
    """
16
17
    # ------------------------------------------------------------------------------------------------------------------
18 1
    def __init__(self, io, config):
1 ignored issue
show
Unused Code introduced by
The argument config seems to be unused.
Loading history...
19
        """
20
        Object constructor.
21
22
        :param cleo.styles.output_style.OutputStyle io: The IO object.
23
        :param configparser.SectionProxy config: The section in the config file for the target_format.
24
        """
25 1
        self._io = io
26
        """
27
        The IO object.
28
29
        :type: cleo.styles.output_style.OutputStyle
30
        """
31
32 1
        self._errors = 0
33 1
        """
34
        The error count.
35
36
        :type: int
37
        """
38
39
    # ------------------------------------------------------------------------------------------------------------------
40 1
    @property
41
    def errors(self):
42
        """
43
        Getter for the error count.
44
45
        :rtype: int
46
        """
47
        return self._errors
48
49
    # ------------------------------------------------------------------------------------------------------------------
50 1
    @abc.abstractmethod
51
    def generate(self):
52
        """
53
        Starts generating HTML file.
54
        """
55
        raise NotImplementedError()
56
57
# ----------------------------------------------------------------------------------------------------------------------
58