Total Complexity | 1 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | 1 | from cleo import OutputFormatterStyle |
|
5 | class SdocStyle(CleoStyle): |
||
6 | """ |
||
7 | Output style for SDocApplication. |
||
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('error', style) |
||
27 | |||
28 | # Style for SDoc1 notices. |
||
29 | style = OutputFormatterStyle('yellow') |
||
30 | output.get_formatter().set_style('notice', style) |
||
31 | |||
33 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.