Completed
Push — publish ( b6ade5...fee4e2 )
by Michael
08:48
created

_echo()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
dl 0
loc 4
rs 10
1
import click
0 ignored issues
show
Bug introduced by
There seems to be a cyclic import (changes -> changes.cli).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (changes -> changes.cli -> changes.commands.init).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (changes -> changes.cli -> changes.commands.init -> changes.config).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
Bug introduced by
There seems to be a cyclic import (changes -> changes.cli -> changes.commands.status).

Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.

Loading history...
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 debug(message):
34
    echo('{}...'.format(message), 'debug')
35
36
37
def info(message):
38
    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