def kill_with_contents(self):
        """
        Kill this Node including the 'logical contents' of the node. i.e. 
        the contents of the node that are self.members as well as non-members. 
        Example: A DnaSegment's logical contents are AxisChunks and StrandChunks 
        Out of these, only AxisChunks are the direct members of the DnaSegment
        but the 'StrandChunks are logical contents of it (non-members) . 
        So, some callers may specifically want to delete self along with its 
        members and logical contents. These callers should use this method. 
        The default implementation just calls self.kill()
        @see: B{Node.DnaSegment.kill_with_contents}  which is overridden here
              method. 
        @see: EditCommand._removeStructure() which calls this Node API method
        @see: DnaDuplex_EditCommand._removeSegments()
        @see: dna_model.DnaLadder.kill_strand_chunks() for a comment.
        
        @see: A note in self.kill() about NFR bug 2749
        
        """
        for member in self.members:
            if isinstance(member, DnaAxisChunk):
                ladder = member.ladder
                try:
                    #See a note in dna_model.kill_strand_chunks. Should we
                    #instead call ladder.kill() and thus kill bothstrand
                    #and axis chunks. ?
                    ladder.kill_strand_chunks()
                except:
                    print_compact_traceback("bug in killing the ladder chunk")

        DnaStrandOrSegment.kill_with_contents(self)
Example #2
0
 def kill_with_contents(self):  
     """
     Kill this Node including the 'logical contents' of the node. i.e. 
     the contents of the node that are self.members as well as non-members. 
     Example: A DnaSegment's logical contents are AxisChunks and StrandChunks 
     Out of these, only AxisChunks are the direct members of the DnaSegment
     but the 'StrandChunks are logical contents of it (non-members) . 
     So, some callers may specifically want to delete self along with its 
     members and logical contents. These callers should use this method. 
     The default implementation just calls self.kill()
     @see: B{Node.DnaSegment.kill_with_contents}  which is overridden here
           method. 
     @see: EditCommand._removeStructure() which calls this Node API method
     @see: InsertDna_EditCommand._removeSegments()
     @see: dna_model.DnaLadder.kill_strand_chunks() for a comment.
     
     @see: A note in self.kill() about NFR bug 2749
     
     """   
     for member in self.members:            
         if isinstance(member, DnaAxisChunk):                
             ladder = member.ladder
             try:
                 #See a note in dna_model.kill_strand_chunks. Should we 
                 #instead call ladder.kill() and thus kill bothstrand 
                 #and axis chunks. ?
                 ladder.kill_strand_chunks()
             except:
                 print_compact_traceback("bug in killing the ladder chunk")
     
     DnaStrandOrSegment.kill_with_contents(self)