(self)
Remove the frames according to the paste spec.
Remove the frames according to the paste spec.
Remove the frames according to the paste spec .
def filter_hidden_frames(self):
        """Remove the frames according to the paste spec."""
        if not self.frames:
            return

        new_frames = []
        hidden = False
        for frame in self.frames:
            hide = frame.hide
            if hide in ('before', 'before_and_this'):
                new_frames = []
                hidden = False
                if hide == 'before_and_this':
                    continue
            elif hide in ('reset', 'reset_and_this'):
                hidden = False
                if hide == 'reset_and_this':
                    continue
            elif hide in ('after', 'after_and_this'):
                hidden = True
                if hide == 'after_and_this':
                    continue
            elif hide or hidden:
                continue
            new_frames.append(frame)

        # if we only have one frame and that frame is from the codeop
        # module, remove it.
        if len(new_frames) == 1 and self.frames[0].module == 'codeop':
            del self.frames[:]

        # if the last frame is missing something went terrible wrong :(
        elif self.frames[-1] in new_frames:
            self.frames[:] = new_frames
def filter_hidden_frames ( self ) : if not self . frames : return new_frames = [ ] hidden = False for frame in self . frames : hide = frame . hide if hide in ( 'before' , 'before_and_this' ) : new_frames = [ ] hidden = False if hide == 'before_and_this' : continue elif hide in ( 'reset' , 'reset_and_this' ) : hidden = False if hide == 'reset_and_this' : continue elif hide in ( 'after' , 'after_and_this' ) : hidden = True if hide == 'after_and_this' : continue elif hide or hidden : continue new_frames . append ( frame ) # if we only have one frame and that frame is from the codeop # module, remove it. if len ( new_frames ) == 1 and self . frames [ 0 ] . module == 'codeop' : del self . frames [ : ] # if the last frame is missing something went terrible wrong :( elif self . frames [ - 1 ] in new_frames : self . frames [ : ] = new_frames