Passed
Push — master ( 95757f...1637f4 )
by Konrad
01:28
created

db_sync_tool.utility.info.print_footer()   B

Complexity

Conditions 6

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 19
rs 8.6666
c 0
b 0
f 0
cc 6
nop 0
1
#!/usr/bin/env python3
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
# -*- coding: future_fstrings -*-
3
4
import sys
0 ignored issues
show
Unused Code introduced by
The import sys seems to be unused.
Loading history...
5
import json
0 ignored issues
show
Unused Code introduced by
The import json seems to be unused.
Loading history...
6
import os
0 ignored issues
show
Unused Code introduced by
The import os seems to be unused.
Loading history...
7
from db_sync_tool.utility import mode, system, output
8
from db_sync_tool import info
9
10
11
def print_header(mute):
12
    """
13
    Printing console header
14
    :param mute: Boolean
15
    :return:
16
    """
17
18
    if mute is False:
19
        print(output.CliFormat.BLACK + '##############################################' + output.CliFormat.ENDC)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (112/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
20
        print(output.CliFormat.BLACK + '#                                            #' + output.CliFormat.ENDC)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (112/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
21
        print(
22
            output.CliFormat.BLACK + '#' + output.CliFormat.ENDC + '                DB SYNC TOOL                ' + output.CliFormat.BLACK + '#' + output.CliFormat.ENDC)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (169/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
23
        print(output.CliFormat.BLACK + '#                   v' + info.__version__ + '                   #' + output.CliFormat.ENDC)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (131/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
24
        print(output.CliFormat.BLACK + '#  ' + info.__homepage__ + '  #' + output.CliFormat.ENDC)
25
        print(output.CliFormat.BLACK + '#                                            #' + output.CliFormat.ENDC)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (112/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
26
        print(output.CliFormat.BLACK + '##############################################' + output.CliFormat.ENDC)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (112/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
27
28
29
def print_footer():
30
    """
31
    Printing console footer
32
    :return:
33
    """
34
    if system.config['dry_run']:
35
        _message = 'Successfully executed dry run'
36
    elif not system.config['keep_dump'] and not system.config['is_same_client'] and not mode.is_import():
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (105/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
37
        _message = 'Successfully synchronized databases'
38
    elif mode.is_import():
39
        _message = 'Successfully imported database dump'
40
    else:
41
        _message = 'Successfully created database dump'
42
43
    output.message(
44
        output.Subject.INFO,
45
        _message,
46
        True,
47
        True
48
    )
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...