dav_tools.messages.formatted_text

Utilities for handling text formatting.

Classes

FormattedText

Represents text with optional formatting options applied.

Module Contents

class dav_tools.messages.formatted_text.FormattedText(text, *options)

Represents text with optional formatting options applied.

Parameters:
  • text (str) – The text content to be formatted.

  • options (bytes) – Optional formatting options to be applied to the text.

get_format()

Constructs the formatting string based on the provided options.

Returns:

A string representing the combined formatting options.

Return type:

str

static reset_format()

Provides the reset formatting string to clear any applied styles.

Returns:

A string representing the reset formatting option.

Return type:

str