StringFormatter#

class osaft.core.helper.StringFormatter[source]#

Bases: object

Consistent Formatting for __str__ and __repr__ methods

Public Methods:

get_str_text(description, variable, value[, ...])

Returns a constant formatting for the __str__ method of the ARF classes


static get_str_text(description, variable, value, unit=None, linebreak=True)[source]#

Returns a constant formatting for the __str__ method of the ARF classes

Parameters:
  • description (str) – Physical name for the variable

  • variable (str) – symbol/name of the variable

  • value (float | int | str | Enum) – value of the variable

  • unit (None | str, optional) – unit of the variable

    Default: None

  • linebreak (bool, optional) – Appends a linebreak to the end of the text

    Default: True

Return type:

str