dav_tools.messages.utils

Utility functions for messages.

Functions

read_input(*format_options[, secret, file])

Ask input from a user using specified styling options.

clear_line([file, flush])

Clears the current line from any text of formatting.

Module Contents

dav_tools.messages.utils.read_input(*format_options, secret=False, file=_sys.stderr)

Ask input from a user using specified styling options.

Parameters:
  • format_options (bytes) – Text styling options.

  • secret (bool) – Whether to hide the input.

  • file – Stream to use for output.

Returns:

User input.

Return type:

str

dav_tools.messages.utils.clear_line(file=_sys.stdout, flush=False)

Clears the current line from any text of formatting. Not really suitable for files.

Parameters:
  • file – Stream to clear.

  • flush (bool) – Whether to flush the stream after printing.

Return type:

None