facebook360_dep
Facebook360 Depth Estimation Pipeline
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
log_reader.LogReader Class Reference
Inheritance diagram for log_reader.LogReader:

Public Member Functions

def __init__ (self, log_textbox, parent, log_file)
 
def close_log_file (self)
 
def get_process (self, id)
 
def get_processes (self)
 
def setup_process (self, id)
 
def start_process (self, id, cmd)
 
def remove_processes (self)
 
def remove_process (self, id)
 
def end_process (self, id, signal=None)
 
def end_all_processes (self, signal="kill")
 
def kill_all_processes (self)
 
def terminate_all_processes (self)
 
def is_running (self, id=None)
 
def set_tab_widget (self, tab_widget, tab_index)
 
def read_stdout (self, id)
 
def are_same_progress (self, str1, str2)
 
def merge_progress_lines (self, lines)
 
def append_output (self, text)
 
def switch_tab (self)
 
def log (self, str)
 
def colored_html (self, str, color)
 
def log_notice (self, str)
 
def log_warning (self, str)
 
def log_error (self, str)
 
def log_header (self)
 

Public Attributes

 parent
 
 processes
 
 decoder_stdout
 
 log_textbox
 
 cursor_output
 
 log_str
 
 progress
 
 app_name
 
 gb
 
 tab_widget
 
 tab_index
 
 log_file
 
 log_f
 

Static Public Attributes

 process_signal = pyqtSignal(str)
 

Detailed Description

Back end for the logging used for printing to the terminal box in the UI.

Attributes:
    app_name (str): Name of the binary being executed.
    cursor_output (QtWidgets.QTextCursor): Cursor in the Qt Textbox.
    decoder_stdout (QTextCodec): Codec for decoding the output.
    gb (QtWidgets.QGroupBox): Group box for the tab.
    log_f (file handle): File handle to the local logging file.
    log_file (str): Path to the local logging file.
    log_textbox (QtWidgets.QPlainTextEdit): Textbox where logs are displayed.
    parent (App(QDialog)): Object corresponding to the parent UI element.
    process_signal (pyqtSignal): Signal tying signals caught by the LogReader to event.
    processes (dict[str, QtCore.QProcess]): Map from process names to processes.
    progress (str): Token used for displaying progress in the render application (used
        for merging double outputs).
    tab_index (int): Index of which tab the app is being run on.
    tab_widget (Union[Background, Calibration, DepthEstimation, Export]): Widget of any
        of the tabs. This can be extended if the UI is expanded.

Constructor & Destructor Documentation

◆ __init__()

def log_reader.LogReader.__init__ (   self,
  log_textbox,
  parent,
  log_file 
)
Initializes a LogReader with the default display configuration.

Args:
    log_textbox (QtWidgets.QPlainTextEdit): Textbox where logs are displayed.
    parent (App(QDialog)): Object corresponding to the parent UI element.
    log_file (str): Path to the logging file on disk.

Member Function Documentation

◆ append_output()

def log_reader.LogReader.append_output (   self,
  text 
)
Print output to the end of the log.

Args:
    text (str): Text being added.

◆ are_same_progress()

def log_reader.LogReader.are_same_progress (   self,
  str1,
  str2 
)
Whether or not two names correspond to the same process.

Args:
    str1 (str): Name of the first process.
    str2 (str): Name of the second process.

Returns:
    bool: Whether or not they are the same QProcess.

◆ close_log_file()

def log_reader.LogReader.close_log_file (   self)
Releases the file handle on the logging file.

◆ colored_html()

def log_reader.LogReader.colored_html (   self,
  str,
  color 
)

◆ end_all_processes()

def log_reader.LogReader.end_all_processes (   self,
  signal = "kill" 
)
Stops all running processes.

Args:
    signal (str, optional): Termination signal to send to the process.

◆ end_process()

def log_reader.LogReader.end_process (   self,
  id,
  signal = None 
)
Stops a running process.

Args:
    id (str): Name of the process.
    signal (str, optional): Termination signal to send to the process.

◆ get_process()

def log_reader.LogReader.get_process (   self,
  id 
)
Gets the QT process associated with a name.

Args:
    id (str): Name of the process.

Returns:
    QtCore.QProcess: Process that is being run.

◆ get_processes()

def log_reader.LogReader.get_processes (   self)
Finds all running processes.

Returns:
    list[QtCore.QProcess]: List of running processes.

◆ is_running()

def log_reader.LogReader.is_running (   self,
  id = None 
)
Check whether or not a process is running.

Args:
    id (str, optional): Name of the process.

Returns:
    QtCore.QProcess.ProcessState: State of the associated process.

◆ kill_all_processes()

def log_reader.LogReader.kill_all_processes (   self)
Sends a SIGKILL to all running processes.

◆ log()

def log_reader.LogReader.log (   self,
  str 
)
Write plain text to the terminal.

Args:
    str (str): Text to be written to the UI terminal.

◆ log_error()

def log_reader.LogReader.log_error (   self,
  str 
)
Write plain text to the terminal in error highlight (red).

Args:
    str (str): Text to be written to the UI terminal.

◆ log_header()

def log_reader.LogReader.log_header (   self)
Write plain text header to the terminal.

◆ log_notice()

def log_reader.LogReader.log_notice (   self,
  str 
)
Write plain text to the terminal in notice highlight (green).

Args:
    str (str): Text to be written to the UI terminal.

◆ log_warning()

def log_reader.LogReader.log_warning (   self,
  str 
)
Write plain text to the terminal in warning highlight (yellow).

Args:
    str (str): Text to be written to the UI terminal.

◆ merge_progress_lines()

def log_reader.LogReader.merge_progress_lines (   self,
  lines 
)
Merge the stdout lines and overwrite the first with the second.

Args:
    lines (list[str]): Lines of the log to be displayed.

Returns:
    list[str]: List with lines merged that start with the same token.

◆ read_stdout()

def log_reader.LogReader.read_stdout (   self,
  id 
)
Print stdout from a particular process execution to the log.

Args:
    id (str): Name of the process.

◆ remove_process()

def log_reader.LogReader.remove_process (   self,
  id 
)
Remove a process from the list of queued processes.

Args:
    id (str): Name of the process.

◆ remove_processes()

def log_reader.LogReader.remove_processes (   self)
Removes all processes from the list of queued processes.

◆ set_tab_widget()

def log_reader.LogReader.set_tab_widget (   self,
  tab_widget,
  tab_index 
)

◆ setup_process()

def log_reader.LogReader.setup_process (   self,
  id 
)
Configures environment variables and displays pre-run warnings.

Args:
    id (str): Name of the process.

◆ start_process()

def log_reader.LogReader.start_process (   self,
  id,
  cmd 
)
Begins executing a process.

Args:
    id (str): Name of the process.
    cmd (str): Command to be run in the process.

◆ switch_tab()

def log_reader.LogReader.switch_tab (   self)
Change the actively displayed tab to the current tab.

◆ terminate_all_processes()

def log_reader.LogReader.terminate_all_processes (   self)
Sends a SIGTERM to all running processes.

Member Data Documentation

◆ app_name

log_reader.LogReader.app_name

◆ cursor_output

log_reader.LogReader.cursor_output

◆ decoder_stdout

log_reader.LogReader.decoder_stdout

◆ gb

log_reader.LogReader.gb

◆ log_f

log_reader.LogReader.log_f

◆ log_file

log_reader.LogReader.log_file

◆ log_str

log_reader.LogReader.log_str

◆ log_textbox

log_reader.LogReader.log_textbox

◆ parent

log_reader.LogReader.parent

◆ process_signal

log_reader.LogReader.process_signal = pyqtSignal(str)
static

◆ processes

log_reader.LogReader.processes

◆ progress

log_reader.LogReader.progress

◆ tab_index

log_reader.LogReader.tab_index

◆ tab_widget

log_reader.LogReader.tab_widget

The documentation for this class was generated from the following file: