/
workspacetexts.py
28 lines (24 loc) · 1.16 KB
/
workspacetexts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
""" Classes corresponding to text blocks within a Workspace context."""
from __future__ import division, print_function, absolute_import, unicode_literals
#*****************************************************************
# pyGSTi 0.9: Copyright 2015 Sandia Corporation
# This Software is released under the GPL license detailed
# in the file "license.txt" in the top-level pyGSTi directory
#*****************************************************************
from .workspace import WorkspaceText
from .textblock import ReportText as _ReportText
class StdoutText(WorkspaceText):
"""A text block showing standard output recorded using
VerbosityPrinter objects"""
def __init__(self, ws, vbRecordedOutput):
"""
A text block of standard output.
Parameters
----------
vbRecordedOutput : list
A list of `(type,level,message)` tuples, one per line/message
as returned by :method:`VerbosityPrinter.stop_recording`.
"""
super(StdoutText,self).__init__(ws, self._create, vbRecordedOutput)
def _create(self, vbRecordedOutput):
return _ReportText(vbRecordedOutput, "VerbosityPrinter")