Total Complexity | 4 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 92.86% |
Changes | 0 |
1 | """ |
||
2 | PyStratum |
||
3 | """ |
||
4 | 1 | from typing import Union |
|
5 | |||
6 | 1 | from cleo import Input, Output |
|
7 | 1 | from cleo.styles import CleoStyle |
|
8 | |||
9 | |||
10 | 1 | class KerapuStyle(CleoStyle): |
|
11 | """ |
||
12 | Output style for Kerapu. |
||
13 | """ |
||
14 | |||
15 | # ------------------------------------------------------------------------------------------------------------------ |
||
16 | 1 | def __init__(self, input: Input, output: Output): |
|
17 | """ |
||
18 | Object constructor. |
||
19 | |||
20 | :param Input input: The input object. |
||
21 | :param Output output: The output object. |
||
22 | """ |
||
23 | 1 | CleoStyle.__init__(self, input, output) |
|
24 | |||
25 | # Create style notes. |
||
26 | 1 | output.get_formatter().add_style('note', 'yellow', None, ['bold']) |
|
27 | |||
28 | # Create style for file and directory names. |
||
29 | 1 | output.get_formatter().add_style('fso', 'white', None, ['bold']) |
|
30 | |||
31 | # ------------------------------------------------------------------------------------------------------------------ |
||
32 | 1 | def text(self, message: Union[str, list, None]): |
|
33 | 1 | if isinstance(message, list): |
|
34 | messages = message |
||
35 | else: |
||
36 | 1 | messages = [message] |
|
37 | |||
38 | 1 | for line in messages: |
|
39 | 1 | self.writeln(' {0}'.format(line)) |
|
40 | |||
42 |