Exemplo n.º 1
0
    def __init__(self, parent, exception=None, val=None):
        QtWidgets.QDialog.__init__(self, parent)
        self._ui = Ui_PythonExpressionPrompt()
        self._ui.setupUi(self)
        self._mainWindow = parent._mainWindow  # get mainWindow instance
        self._val = val  # this is the object that is currently authored
        self._oldValID = -1  # this is the ID of the current object at "_"

        self._setupConsole()  # get or create a python console widget

        # if a exception was passed as an argument, raise it so it prints.
        if exception is not None:
            print >> sys.stderr, exception

        self._ui.buttonBox.button(
            QtWidgets.QDialogButtonBox.Apply).clicked.connect(self.accept)