CliFormat.__init__()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
#!/usr/bin/env python3
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
# -*- coding: utf-8 -*-
3
4
from lighthouse_garden.utility import system
5
6
7
class CliFormat:
8
    """
9
    Provides text colors for command line.
10
    """
11
12
    def __init__(self):
13
        pass
14
15
    BEIGE = '\033[96m'
16
    PURPLE = '\033[95m'
17
    BLUE = '\033[94m'
18
    YELLOW = '\033[93m'
19
    GREEN = '\033[92m'
20
    RED = '\033[91m'
21
    BLACK = '\033[90m'
22
    ENDC = '\033[0m'
23
    BOLD = '\033[1m'
24
    UNDERLINE = '\033[4m'
25
26
27
class Subject:
28
    """
29
    Provides subjects for output in command line.
30
    """
31
32
    def __init__(self):
33
        pass
34
35
    TEST = f'{CliFormat.BEIGE}[TEST]{CliFormat.ENDC}'
36
    INFO = f'{CliFormat.BLUE}[INFO]{CliFormat.ENDC}'
37
    CI = f'{CliFormat.BEIGE}[CI]{CliFormat.ENDC}'
38
    OK = f'{CliFormat.GREEN}[OK]{CliFormat.ENDC}'
39
    WARNING = f'{CliFormat.YELLOW}[WARNING]{CliFormat.ENDC}'
40
    ERROR = f'{CliFormat.RED}[ERROR]{CliFormat.ENDC}'
41
    DEBUG = f'{CliFormat.BLACK}[DEBUG]{CliFormat.ENDC}'
42
    LOCAL = f'{CliFormat.BLACK}[LOCAL]{CliFormat.ENDC}'
43
    REMOTE = f'{CliFormat.BLACK}[REMOTE]{CliFormat.ENDC}'
44
    CMD = f'{CliFormat.BLACK}[CMD]{CliFormat.ENDC}'
45
46
47
def println(message, verbose_only=False):
48
    """
49
    Print a message to the console
50
    :param message: String
51
    :param verbose_only: Boolean
52
    :return:
53
    """
54
    if verbose_only and not system.config['verbose']:
55
        return
56
    print(message)
57