pygsti.report.textblock

Defines the ReportText class

Module Contents

Classes

ReportText

Text representation, renderable in multiple formats

class pygsti.report.textblock.ReportText(text, form=None)

Bases: object

Text representation, renderable in multiple formats

Parameters

textstr, bytes, or list

The text to display, possibly in need of processing as specified by fmt.

form{ None, “VerbosityPrinter” }

What format text is in. If None, then plain text that doesn’t require any processing is assumed. If “VerbosityPrinter”, then text is assumed to be a list of (type, level, message) tuples as recorded by a VerbosityPrinter object.

Create a text-block object

Parameters

textstr, bytes, or list

The text to display, possibly in need of processing as specified by fmt.

form{ None, “VerbosityPrinter” }

What format text is in. If None, then plain text that doesn’t require any processing is assumed. If “VerbosityPrinter”, then text is assumed to be a list of (type, level, message) tuples as recorded by a VerbosityPrinter object.

render(fmt, text_id=None)

Render this text-block object

Parameters
fmtstring

name of format to be used

text_idstring

an ID to use in formats where it is applicable

Returns

string