/[escript]/trunk/pycad/py_src/design.py
ViewVC logotype

Diff of /trunk/pycad/py_src/design.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2682 by jfenwick, Fri Aug 21 06:30:25 2009 UTC revision 2683 by gross, Tue Sep 29 02:20:22 2009 UTC
# Line 287  class Design(object): Line 287  class Design(object):
287         """         """
288         Adds items to the design.         Adds items to the design.
289         """         """
290           new_items=[]
291         for i in range(len(items)):         for i in range(len(items)):
292            if not isinstance(items[i],(Primitive, ReversePrimitive)):            if not isinstance(items[i],(Primitive, ReversePrimitive)):
293               raise TypeError("%s-th argument is not a Primitive object"%i)               raise TypeError("%s-th argument is not a Primitive object"%i)
294            if isinstance(items[i],PropertySet):            if isinstance(items[i],PropertySet):
295               for p in self.getAllPrimitives():               q=items[i]
296                  if isinstance(p, PropertySet):            else:
297                     if items[i].getName() == p.getName():               q=PropertySet("__%s__"%(items[i].getID()), items[i])
298                         raise ValueError("Property set name %s is allready in use."%items[i].getName())            for p in self.getAllPrimitives():
299         for i in items:                if isinstance(p, PropertySet):
300            self.__items.append(i)                  if q.getName() == p.getName():
301                       raise ValueError("Property set name %s is allready in use."%q.getName())
302              new_items.append(q)
303           for q in new_items: self.__items.append(q)
304    
305      def getItems(self):      def getItems(self):
306          """          """

Legend:
Removed from v.2682  
changed lines
  Added in v.2683

  ViewVC Help
Powered by ViewVC 1.1.26