deid.logger package¶
Submodules¶
deid.logger.message module¶
-
class
deid.logger.message.
DeidMessage
(MESSAGELEVEL=None)[source]¶ Bases:
object
-
addColor
(level, text)[source]¶ Add color to the prompt.
addColor to the prompt (usually prefix) if terminal supports, and specified to do so
-
emit
(level, message, prefix=None, color=None)[source]¶ Emit a message.
Emit is the main function to print the message optionally with a prefix
Parameters: - level (the level of the message) –
- message (the message to print) –
- prefix (a prefix for the message) –
-
emitError
(level)[source]¶ Determine if we should emit an error message to stderr.
This includes all levels but INFO and QUIET
-
show_progress
(iteration, total, length=40, min_level=0, prefix=None, carriage_return=True, suffix=None, symbol=None)[source]¶ Create a terminal progress bar. :param iteration: current iteration (Int) :param total: total iterations (Int) :param length: character length of bar (Int)
-
table
(rows, col_width=2)[source]¶ Print a table of entries.
Table will print a table of entries. If the rows is a dictionary, the keys are interpreted as column names. if not, a numbered list is used.
-
-
deid.logger.message.
convert2boolean
(arg)[source]¶ Convert envars to boolean.
convert2boolean is used for environmental variables that must be returned as boolean
-
deid.logger.message.
get_logging_level
()[source]¶ Get the logging level.
get_logging_level will configure a logging to standard out based on the user’s selected level, which should be in an environment variable called MESSAGELEVEL. if MESSAGELEVEL is not set, the maximum level (5) is assumed (all messages).
deid.logger.progress module¶
clint.textui.progress¶
A derivation of clint version, to not introduce a dependency and add custom functionality. Credit to base code goes to https://github.com/kennethreitz/clint/blob/master/clint/textui/progress.py