Completed
Push — master ( a7c9a5...5b4c74 )
by Jaisen
8s
created

progress()   A

Complexity

Conditions 2

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 5

Importance

Changes 0
Metric Value
cc 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
"""
2
General file system methods.
3
4
.. moduleauthor:: Jaisen Mathai <[email protected]>
5
"""
6
from __future__ import print_function
7
8
import sys
9
10
from json import dumps
11
12
from elodie import constants
13
14
15
def info(message):
16
    _print(message)
17
18
19
def info_json(payload):
20
    _print(dumps(payload))
21
22
23
def progress(message='.', new_line=False):
24
    if not new_line:
25
        print(message, end="")
26
    else:
27
        print(message)
28
29
30
def warn(message):
31
    _print(message)
32
33
34
def warn_json(payload):
35
    _print(dumps(payload))
36
37
38
def error(message):
39
    _print(message)
40
41
42
def error_json(payload):
43
    _print(dumps(payload))
44
45
46
def _print(string):
47
    if(constants.debug is True):
48
        print(string)
49