TaurusMessageBox

digraph inheritance73f480411a { rankdir=UD; ratio=compress; size="8.0, 12.0"; "QDialog" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "QWidget" -> "QDialog" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QObject" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "wrapper" -> "QObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPaintDevice" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "simplewrapper" -> "QPaintDevice" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QWidget" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "QObject" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QPaintDevice" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaurusMessageBox" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="A panel intended to display a taurus error."]; "QDialog" -> "TaurusMessageBox" [arrowsize=0.5,style="setlinewidth(0.5)"]; "simplewrapper" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "wrapper" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded]; "simplewrapper" -> "wrapper" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class TaurusMessageBox(err_type=None, err_value=None, err_traceback=None, parent=None, designMode=False)[source]

Bases: PyQt4.QtGui.QDialog

A panel intended to display a taurus error. Example:

dev = taurus.Device("sys/tg_test/1")
try:
    print dev.read_attribute("throw_exception")
except PyTango.DevFailed, df:
    msgbox = TaurusMessageBox()
    msgbox.show()

You can show the error outside the exception handling code. If you do this, you should keep a record of the exception information as given by sys.exc_info():

dev = taurus.Device("sys/tg_test/1")
exc_info = None
try:
    print dev.read_attribute("throw_exception")
except PyTango.DevFailed, df:
    exc_info = sys.exc_info()

if exc_info:
    msgbox = TaurusMessageBox(*exc_info)
    msgbox.show()
addButton(button, role=3)[source]

Adds the given button with the given to the button box

Parameters:
  • button (PyQt4.QtGui.QPushButton) – the button to be added
  • role (PyQt4.Qt.QDialogButtonBox.ButtonRole) – button role
getText()[source]

Returns the current text of this panel

Returns:the text for this panel
Return type:str
panel()[source]

Returns the taurus.qt.qtgui.panel.TaurusMessagePanel.

Returns:the internal panel
Return type:taurus.qt.qtgui.panel.TaurusMessagePanel
setDetailedText(text)[source]

Sets the detailed text of the dialog

Parameters:text (str) – the new text
setError(err_type=None, err_value=None, err_traceback=None)[source]

Sets the exception object. Example usage:

dev = taurus.Device("sys/tg_test/1")
exc_info = None
msgbox = TaurusMessageBox()
try:
    print dev.read_attribute("throw_exception")
except PyTango.DevFailed, df:
    exc_info = sys.exc_info()

if exc_info:
    msgbox.setError(*exc_info)
    msgbox.show()
Parameters:
  • err_type – the exception type of the exception being handled (a class object)
  • err_value (object) – exception object
  • err_traceback (TracebackType) – a traceback object which encapsulates the call stack at the point where the exception originally occurred
setIconPixmap(pixmap)[source]

Sets the icon to the dialog

Parameters:pixmap (PyQt4.Qt.QPixmap) – the icon pixmap
setText(text)[source]

Sets the text of the dialog

Parameters:text (str) – the new text