trepan/processor/command/info_subcmd/program.py
def run(self, args):
        """Execution status of the program."""
        mainfile = self.core.filename(None)
        if self.core.is_running():
            if mainfile:
                part1 = "Python program '%s' is stopped" % mainfile
            else:
                part1 = 'Program is stopped'
                pass
            if self.proc.event:
                msg = 'via a %s event.' % self.proc.event
            else:
                msg = '.'
            self.msg(Mmisc.wrapped_lines(part1, msg,
                                         self.settings['width']))
            if self.proc.curframe:
                self.msg("PC offset is %d." % self.proc.curframe.f_lasti)

            if self.proc.event == 'return':
                val = self.proc.event_arg
                part1 = 'Return value is'
                self.msg(Mmisc.wrapped_lines(part1, self.proc._saferepr(val),
                                             self.settings['width']))
                pass
            elif self.proc.event == 'exception':
                exc_type, exc_value, exc_tb = self.proc.event_arg
                self.msg('Exception type: %s' %
                         self.proc._saferepr(exc_type))
                if exc_value:
                    self.msg('Exception value: %s' %
                             self.proc._saferepr(exc_value))
                    pass
                pass
            self.msg('It stopped %s.' % self.core.stop_reason)
            if self.proc.event in ['signal', 'exception', 'c_exception']:
                self.msg('Note: we are stopped *after* running the '
                         'line shown.')
                pass
        else:
            if mainfile:
                part1 = "Python program '%s'" % mainfile
                msg   = "is not currently running. "
                self.msg(Mmisc.wrapped_lines(part1, msg,
                                             self.settings['width']))
            else:
                self.msg('No Python program is currently running.')
                pass
            self.msg(self.core.execution_status)
            pass
        return False
def run(self, args):
        mainfile = self.core.filename(None)
        if self.core.is_running():
            if mainfile:
                part1 = "Python program '%s' is stopped" % mainfile
            else:
                part1 = 'Program is stopped'
                pass
            if self.proc.event:
                msg = 'via a %s event.' % self.proc.event
            else:
                msg = '.'
            self.msg(Mmisc.wrapped_lines(part1, msg,
                                         self.settings['width']))
            if self.proc.curframe:
                self.msg("PC offset is %d." % self.proc.curframe.f_lasti)

            if self.proc.event == 'return':
                val = self.proc.event_arg
                part1 = 'Return value is'
                self.msg(Mmisc.wrapped_lines(part1, self.proc._saferepr(val),
                                             self.settings['width']))
                pass
            elif self.proc.event == 'exception':
                exc_type, exc_value, exc_tb = self.proc.event_arg
                self.msg('Exception type: %s' %
                         self.proc._saferepr(exc_type))
                if exc_value:
                    self.msg('Exception value: %s' %
                             self.proc._saferepr(exc_value))
                    pass
                pass
            self.msg('It stopped %s.' % self.core.stop_reason)
            if self.proc.event in ['signal', 'exception', 'c_exception']:
                self.msg('Note: we are stopped *after* running the '
                         'line shown.')
                pass
        else:
            if mainfile:
                part1 = "Python program '%s'" % mainfile
                msg   = "is not currently running. "
                self.msg(Mmisc.wrapped_lines(part1, msg,
                                             self.settings['width']))
            else:
                self.msg('No Python program is currently running.')
                pass
            self.msg(self.core.execution_status)
            pass
        return False
def run ( self , args ) : mainfile = self . core . filename ( None ) if self . core . is_running ( ) : if mainfile : part1 = "Python program '%s' is stopped" % mainfile else : part1 = 'Program is stopped' pass if self . proc . event : msg = 'via a %s event.' % self . proc . event else : msg = '.' self . msg ( Mmisc . wrapped_lines ( part1 , msg , self . settings [ 'width' ] ) ) if self . proc . curframe : self . msg ( "PC offset is %d." % self . proc . curframe . f_lasti ) if self . proc . event == 'return' : val = self . proc . event_arg part1 = 'Return value is' self . msg ( Mmisc . wrapped_lines ( part1 , self . proc . _saferepr ( val ) , self . settings [ 'width' ] ) ) pass elif self . proc . event == 'exception' : exc_type , exc_value , exc_tb = self . proc . event_arg self . msg ( 'Exception type: %s' % self . proc . _saferepr ( exc_type ) ) if exc_value : self . msg ( 'Exception value: %s' % self . proc . _saferepr ( exc_value ) ) pass pass self . msg ( 'It stopped %s.' % self . core . stop_reason ) if self . proc . event in [ 'signal' , 'exception' , 'c_exception' ] : self . msg ( 'Note: we are stopped *after* running the ' 'line shown.' ) pass else : if mainfile : part1 = "Python program '%s'" % mainfile msg = "is not currently running. " self . msg ( Mmisc . wrapped_lines ( part1 , msg , self . settings [ 'width' ] ) ) else : self . msg ( 'No Python program is currently running.' ) pass self . msg ( self . core . execution_status ) pass return False
Execution status of the program.
Execution status of the program .