Completed
Pull Request — master (#124)
by
unknown
30:53 queued 21:01
created

note_style()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 2
ccs 0
cts 0
cp 0
crap 2
rs 10
1 3
import click
2
3 3
STYLES = {
4
    'debug': {
5
        'fg': 'blue',
6
    },
7
    'info': {
8
        'fg': 'green',
9
        'bold': True,
10
    },
11
    'highlight': {
12
        'fg': 'cyan',
13
        'bold': True,
14
    },
15
    'note': {
16
        'fg': 'blue',
17
        'bold': True,
18
    },
19 3
    'error': {
20 3
        'fg': 'red',
21
        'bold': True,
22
    }
23
}
24
25
26 3
def echo(message, style):
27 3
    click.secho(
28
        str(message),
29
        **STYLES[style]
30 3
    )
31 3
32
33
def debug(message):
34 3
    echo('{}...'.format(message), 'debug')
35 3
36
37
def info(message):
38 3
    echo('{}...'.format(message), 'info')
39
40
41
def note(message):
42
    echo(message, 'note')
43
44
45
def note_style(message):
46
    return click.style(message, **STYLES['note'])
47
48
49
def highlight(message):
50
    return click.style(message, **STYLES['highlight'])
51
52
53
def error(message):
54
    echo(message, 'error')
55