smartinspectpython.silistviewercontext

@export
class SIListViewerContext(smartinspectpython.sitextcontext.SITextContext):

Represents the list viewer in the Console which can display simple lists of text data.

The list viewer in the Console interprets the Log Entry Data as a list. Every line in the text data is interpreted as one item of the list. This class takes care of the necessary formatting and escaping required by the corresponding list viewer in the Console.

You can use the SIListViewerContext class for creating custom log methods around SISession.LogCustomContext for sending custom data organized as simple lists.

Threadsafety:

This class is not guaranteed to be thread-safe.

SIListViewerContext(vi: smartinspectpython.siviewerid.SIViewerId = None)

Initializes a new instance of the class.

Arguments:
  • vi (SIViewerId): The viewer ID to use; if None, then ViewId.List is used.
@staticmethod
def EscapeLine(line: str, toEscape: str = None) -> str:

Escapes a line.

Arguments:
  • line (str): The line to escape.
  • toEscape (str): A set of characters which should be escaped in addition to the newline characters, or an empty string if there are none.
Returns:

The escaped line.

This method ensures that the escaped line does not contain characters listed in the toEscape parameter plus any newline characters, such as the carriage return or linefeed characters.