2016-11-09 07:41:00 +01:00
|
|
|
"""
|
|
|
|
General file system methods.
|
|
|
|
|
|
|
|
.. moduleauthor:: Jaisen Mathai <jaisen@jmathai.com>
|
|
|
|
"""
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
from json import dumps
|
|
|
|
|
|
|
|
from elodie import constants
|
|
|
|
|
|
|
|
|
|
|
|
def info(message):
|
|
|
|
_print(message)
|
|
|
|
|
|
|
|
|
|
|
|
def info_json(payload):
|
|
|
|
_print(dumps(payload))
|
|
|
|
|
|
|
|
|
2016-12-20 06:12:36 +01:00
|
|
|
def progress(message='.', new_line=False):
|
|
|
|
if not new_line:
|
|
|
|
print(message, end="")
|
|
|
|
else:
|
|
|
|
print(message)
|
|
|
|
|
|
|
|
|
2016-11-09 07:41:00 +01:00
|
|
|
def warn(message):
|
|
|
|
_print(message)
|
|
|
|
|
|
|
|
|
|
|
|
def warn_json(payload):
|
|
|
|
_print(dumps(payload))
|
|
|
|
|
|
|
|
|
|
|
|
def error(message):
|
|
|
|
_print(message)
|
|
|
|
|
|
|
|
|
|
|
|
def error_json(payload):
|
|
|
|
_print(dumps(payload))
|
|
|
|
|
|
|
|
|
|
|
|
def _print(string):
|
|
|
|
if(constants.debug is True):
|
|
|
|
print(string)
|