def qtePrepareToRun(self):
        """
        This method is called by Qtmacs to prepare the macro for
        execution.

        It is probably a bad idea to overload this method as it only
        administrates the macro execution and calls the ``qteRun``
        method (which *should* be overloaded by the macro programmer
        in order for the macro to do something).

        |Args|

        * **None**

        |Returns|

        * **None**

        |Raises|

        * **None**
        """

        # Report the execution attempt.
        msgObj = QtmacsMessage((self.qteMacroName(), self.qteWidget), None)
        msgObj.setSignalName('qtesigMacroStart')
        self.qteMain.qtesigMacroStart.emit(msgObj)

        # Try to run the macro and radio the success via the
        # ``qtesigMacroFinished`` signal.
        try:
            self.qteRun()
            self.qteMain.qtesigMacroFinished.emit(msgObj)
        except Exception as err:
            if self.qteApplet is None:
                appID = appSig = None
            else:
                appID = self.qteApplet.qteAppletID()
                appSig = self.qteApplet.qteAppletSignature()
            msg = ('Macro <b>{}</b> (called from the <b>{}</b> applet'
                   ' with ID <b>{}</b>) did not execute properly.')
            msg = msg.format(self.qteMacroName(), appSig, appID)

            if isinstance(err, QtmacsArgumentError):
                msg += '<br/>' + str(err)

            # Irrespective of the error, log it, enable macro
            # processing (in case it got disabled), and trigger the
            # error signal.
            self.qteMain.qteEnableMacroProcessing()
            self.qteMain.qtesigMacroError.emit(msgObj)
            self.qteLogger.exception(msg, exc_info=True, stack_info=True)
def qtePrepareToRun ( self ) : msgObj = QtmacsMessage ( ( self . qteMacroName ( ) , self . qteWidget ) , None ) msgObj . setSignalName ( 'qtesigMacroStart' ) self . qteMain . qtesigMacroStart . emit ( msgObj ) try : self . qteRun ( ) self . qteMain . qtesigMacroFinished . emit ( msgObj ) except Exception as err : if self . qteApplet is None : appID = appSig = None else : appID = self . qteApplet . qteAppletID ( ) appSig = self . qteApplet . qteAppletSignature ( ) msg = ( 'Macro <b>{}</b> (called from the <b>{}</b> applet' ' with ID <b>{}</b>) did not execute properly.' ) msg = msg . format ( self . qteMacroName ( ) , appSig , appID ) if isinstance ( err , QtmacsArgumentError ) : msg += '<br/>' + str ( err ) self . qteMain . qteEnableMacroProcessing ( ) self . qteMain . qtesigMacroError . emit ( msgObj ) self . qteLogger . exception ( msg , exc_info = True , stack_info = True )
This method is called by Qtmacs to prepare the macro for
        execution.

        It is probably a bad idea to overload this method as it only
        administrates the macro execution and calls the ``qteRun``
        method (which *should* be overloaded by the macro programmer
        in order for the macro to do something).

        |Args|

        * **None**

        |Returns|

        * **None**

        |Raises|

        * **None**