trepan/bwprocessor/main.py
def adjust_frame(self, pos, absolute_pos):
        """Adjust stack frame by pos positions. If absolute_pos then
        pos is an absolute number. Otherwise it is a relative number.

        A negative number indexes from the other end."""
        if not self.curframe:
            Mmsg.errmsg(self, "No stack.")
            return

        # Below we remove any negativity. At the end, pos will be
        # the new value of self.curindex.
        if absolute_pos:
            if pos >= 0:
                pos = len(self.stack)-pos-1
            else:
                pos = -pos-1
        else:
            pos += self.curindex

        if pos < 0:
            Mmsg.errmsg(self,
                        "Adjusting would put us beyond the oldest frame.")
            return
        elif pos >= len(self.stack):
            Mmsg.errmsg(self,
                        "Adjusting would put us beyond the newest frame.")
            return

        self.curindex = pos
        self.curframe = self.stack[self.curindex][0]
        self.print_location()
        self.list_lineno = None
        return
def adjust_frame(self, pos, absolute_pos):
        """Adjust stack frame by pos positions. If absolute_pos then
        pos is an absolute number. Otherwise it is a relative number.

        A negative number indexes from the other end."""
        if not self.curframe:
            Mmsg.errmsg(self, "No stack.")
            return

        # Below we remove any negativity. At the end, pos will be
        # the new value of self.curindex.
        if absolute_pos:
            if pos >= 0:
                pos = len(self.stack)-pos-1
            else:
                pos = -pos-1
        else:
            pos += self.curindex

        if pos < 0:
            Mmsg.errmsg(self,
                        "Adjusting would put us beyond the oldest frame.")
            return
        elif pos >= len(self.stack):
            Mmsg.errmsg(self,
                        "Adjusting would put us beyond the newest frame.")
            return

        self.curindex = pos
        self.curframe = self.stack[self.curindex][0]
        self.print_location()
        self.list_lineno = None
        return
def adjust_frame ( self , pos , absolute_pos ) : if not self . curframe : Mmsg . errmsg ( self , "No stack." ) return # Below we remove any negativity. At the end, pos will be # the new value of self.curindex. if absolute_pos : if pos >= 0 : pos = len ( self . stack ) - pos - 1 else : pos = - pos - 1 else : pos += self . curindex if pos < 0 : Mmsg . errmsg ( self , "Adjusting would put us beyond the oldest frame." ) return elif pos >= len ( self . stack ) : Mmsg . errmsg ( self , "Adjusting would put us beyond the newest frame." ) return self . curindex = pos self . curframe = self . stack [ self . curindex ] [ 0 ] self . print_location ( ) self . list_lineno = None return
Adjust stack frame by pos positions. If absolute_pos then
        pos is an absolute number. Otherwise it is a relative number.

        A negative number indexes from the other end.
Adjust stack frame by pos positions . If absolute_pos then pos is an absolute number . Otherwise it is a relative number .