Indenter

class dictIO.utils.counter.Indenter(tab_size: int = 4, tab_char: str = ' ')

Bases: object

A class that implements a static global indentation.

Instances of this class all share the same global indentation. This is used in the logger utilities to ensure a readable message hierarchy.

Parameters:
  • tab_size (int)

  • tab_char (str)

Ind

Shared storage for the indentation level and formatting settings.

Type:

ClassVar[dictIO.utils.counter._IndentationState]

__init__(tab_size: int = 4, tab_char: str = ' ') → None

Initialize shared indentation formatting settings.

Parameters:
  • tab_size (int) – Number of characters per indentation level. Defaults to 4.

  • tab_char (str) – Character used to render indentation. Defaults to “ “.

Return type:

None

Methods

__init__([tab_size, tab_char])

Initialize shared indentation formatting settings.

decr([decrease])

Decrease the shared indentation level.

incr([increase])

Increase the shared indentation level.

reset()

Reset the Indent.

Attributes

Ind

static decr(decrease: int = 1) → None

Decrease the shared indentation level.

Parameters:

decrease (int) – Amount to decrease the indentation level. Defaults to 1.

Return type:

None

static incr(increase: int = 1) → None

Increase the shared indentation level.

Parameters:

increase (int) – Amount to increase the indentation level. Defaults to 1.

Return type:

None

static reset() → None

Reset the Indent.

Return type:

None

Ind: ClassVar[_IndentationState] = {'Indent': 0, 'TabChar': ' ', 'TabSize': 4}