pypeit.setup_gui.text_viewer module
Classes for displaying text content to a Qt window.
- class pypeit.setup_gui.text_viewer.LogWindow(logBuffer: LogBuffer)[source]
Bases:
TextViewerWindow
Text window for viewing the PypeIt log messages as they occurr. logBuffer: LogBuffer receiving PypeIt log messages.
- _messageLogged(message: str)[source]
Callback that is notified by the log buffer for each message logged.
- Parameters:
message – The log message
- closeEvent(event: QEvent)[source]
Event handle for closing the log window. Overridden from QWidget.
- Parameters:
event – The close event. Not used by this implementation.
- newMessage
Signal sent when a new log message is logged.
- class pypeit.setup_gui.text_viewer.TextViewerWindow(title: str, width: int, height: int, text_stream: TextIOBase, start_at_top: bool, filename: str | Path | None = None, file_type: FileType = FileType(name='Text Files', extension='.txt'))[source]
Bases:
QWidget
Window to display text. The text can also be saved to a file.
- Parameters:
title – Title for the window
width – Initial width of the window, in characters.
height – Initial height of the window, in characters.
filename – Name of the file being viewed.
text_stream – The file object for the text to display.
start_at_top – Whether to start with the window scrolled to the top of the text.
filters – File extension filters for saving the file, in the format used by QFileDialog. Defaults to [“Text Files (‘*’.txt)”]
- closeEvent(event)[source]
Event handle for closing the log window. Overridden from QWidget.
- Parameters:
event (QEvent) – The close event. Not used by this implementation.
- closed
Signal sent when the window is closed.