BasicTools.Helpers.TextFormatHelper module

Class to format output

BasicTools.Helpers.TextFormatHelper.CheckIntegrity()[source]
class BasicTools.Helpers.TextFormatHelper.TFormat[source]

Bases: object

Format Helper class (indentation and color)

static AddToExtra(extra=0)[source]
static Center(text, fill='*', width=60)[source]
static CleanFormat()[source]
static DI(extra=0)[source]

Decrease indentation level

static GetIndent()[source]

Generate a string with the correct number on spaces

static GoodBad(text, test)[source]
static II(extra=0)[source]

Increase indentation level

static InBlue(text='')[source]
static InBlueBackGround(text='')[source]
static InGreen(text='')[source]
static InGreenBackGround(text='')[source]
static InGrey(text='')[source]
static InGreyBackGround(text='')[source]
static InIPython()[source]
static InPurple(text='')[source]
static InPurpleBackGround(text='')[source]
static InRed(text='')[source]
static InRedBackGround(text='')[source]
static InYellow(text='')[source]
static InYellowBackGround(text='')[source]
static Left(text, fill='*', width=60)[source]
static Reset()[source]

Reset the indentation state

static SupportsColor()[source]

Returns True if the running system’s terminal supports color, and False otherwise.

static WithColor(text, color)[source]
static WithItalic(text='')[source]
static WithUnderline(text='')[source]
BasicTools.Helpers.TextFormatHelper.strip_ANSI_escape_sequences_sub(repl, string, count=0)

Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.