Completed
Push — publish ( ab6fe5...6057b5 )
by Michael
06:08
created

note_style()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 2
rs 10
1
import click
2
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
    'error': {
20
        'fg': 'red',
21
        'bold': True,
22
    }
23
}
24
25
26
def _echo(message, style):
27
    click.secho(
28
        str(message),
29
        **STYLES[style]
30
    )
31
32
33
def info(message):
34
    _echo('{}...'.format(message), 'info')
35
36
37
def note(message):
38
    _echo(message, 'note')
39
40
41
def note_style(message):
42
    return click.Style(message, **STYLES['note'])
43
44
45
def highlight(message):
46
    return click.style(message, **STYLES['highlight'])
47
48
49
def error(message):
50
    _echo(message, 'error')
51