(self, stampid)
does the work for clearstamp() and clearstamps()
does the work for clearstamp() and clearstamps()
does the work for clearstamp () and clearstamps ()
def _clearstamp(self, stampid):
        """does the work for clearstamp() and clearstamps()
        """
        if stampid in self.stampItems:
            if isinstance(stampid, tuple):
                for subitem in stampid:
                    self.screen._delete(subitem)
            else:
                self.screen._delete(stampid)
            self.stampItems.remove(stampid)
        # Delete stampitem from undobuffer if necessary
        # if clearstamp is called directly.
        item = ("stamp", stampid)
        buf = self.undobuffer
        if item not in buf.buffer:
            return
        index = buf.buffer.index(item)
        buf.buffer.remove(item)
        if index <= buf.ptr:
            buf.ptr = (buf.ptr - 1) % buf.bufsize
        buf.buffer.insert((buf.ptr+1)%buf.bufsize, [None])
def _clearstamp ( self , stampid ) : if stampid in self . stampItems : if isinstance ( stampid , tuple ) : for subitem in stampid : self . screen . _delete ( subitem ) else : self . screen . _delete ( stampid ) self . stampItems . remove ( stampid ) # Delete stampitem from undobuffer if necessary # if clearstamp is called directly. item = ( "stamp" , stampid ) buf = self . undobuffer if item not in buf . buffer : return index = buf . buffer . index ( item ) buf . buffer . remove ( item ) if index <= buf . ptr : buf . ptr = ( buf . ptr - 1 ) % buf . bufsize buf . buffer . insert ( ( buf . ptr + 1 ) % buf . bufsize , [ None ] )