Changeset 2648:0242e4f084f8 in livinglogic.python.xist

Show
Ignore:
Timestamp:
02/13/07 10:59:26 (13 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add a clone() method to Pool.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/xsc.py

    r2646 r2648  
    37013701        return Comment(content) 
    37023702 
     3703    def clone(self): 
     3704        """ 
     3705        Return a copy of <self/> 
     3706        """ 
     3707        copy = Pool() 
     3708        copy._elementsbyxmlname = self._elementsbyxmlname.copy() 
     3709        copy._elementsbypyname = self._elementsbypyname.copy() 
     3710        copy._procinstsbyxmlname = self._procinstsbyxmlname.copy() 
     3711        copy._procinstsbypyname = self._procinstsbypyname.copy() 
     3712        copy._entitiesbyxmlname = self._entitiesbyxmlname.copy() 
     3713        copy._entitiesbypyname = self._entitiesbypyname.copy() 
     3714        copy._charrefsbyxmlname = self._charrefsbyxmlname.copy() 
     3715        copy._charrefsbypyname = self._charrefsbypyname.copy() 
     3716        copy._charrefsbycodepoint = self._charrefsbycodepoint.copy() 
     3717        copy._attrsbyxmlname = self._attrsbyxmlname.copy() 
     3718        copy._attrsbypyname = self._attrsbypyname.copy() 
     3719        copy.bases = self.bases[:] 
     3720        return copy 
    37033721 
    37043722# Default class pool