Completed
Pull Request — master (#40)
by Oleg
01:53
created

SdocStyle.__init__()   A

Complexity

Conditions 1

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 20
rs 9.4285
cc 1
1
from cleo import OutputFormatterStyle
2
from cleo.styles import CleoStyle
3
4
5
class SdocStyle(CleoStyle):
6
    """
7
    Output style for SDoc.
8
    """
9
10
    # ------------------------------------------------------------------------------------------------------------------
11
    def __init__(self, input, output):
12
        """
13
        Object constructor.
14
15
        :param cleo.inputs.input.Input input: The input object.
16
        :param cleo.outputs.output.Output output: The output object.
17
        """
18
        CleoStyle.__init__(self, input, output)
19
20
        # Style for file system objects (e.g. file and directory names).
21
        style = OutputFormatterStyle('green', None, ['bold'])
22
        output.get_formatter().set_style('fso', style)
23
24
        # Style for errors.
25
        style = OutputFormatterStyle('red', None, ['bold'])
26
        output.get_formatter().set_style('err', style)
27
28
        # Style for warnings.
29
        style = OutputFormatterStyle('yellow', None, ['bold'])
30
        output.get_formatter().set_style('warn', style)
31
32
# ----------------------------------------------------------------------------------------------------------------------
33