Commits

Anonymous committed 2e53bcd

making repeating widgets go further.

  • Participants
  • Parent commits 56f9219

Comments (0)

Files changed (2)

tests/test_resources.py

         rl = twc.core.request_local()
         assert(len(rl.get('resources', [])) == 1)
         out = twc.inject_resources(html)
-        print 'after inject_res'
-        print rl
         eq_(rl.get('resources', []), [])
 
     #--

tw2/core/widgets.py

         ids = set()
         for c in self.children:
             c_id = getattr(c, 'id', None)
-            print c
             if c_id and c_id in ids:
                 raise core.WidgetError("Duplicate id '%s'" % c.id)
             elif c_id:
                 ids.add(c_id)
-        return
-        #xxx: go back for this
-        joined_cld = []
-        for c in self.children:
-            if not isinstance(c, Widget):
-                raise pm.ParameterError("All children must be widgets, not %s"%c)
-            c.parent = weakref.proxy(self)
-            joined_cld.append(c)#(parent=self))
-        ids = set()
-        for c in self.children_deep():
-            if getattr(c, 'id', None):
-                if c.id in ids:
-                    raise core.WidgetError("Duplicate id '%s'" % c.id)
-                ids.add(c.id)
-        self.children = WidgetBunch(joined_cld)
 
     def __init__(self, **kw):
         super(CompoundWidget, self).__init__(**kw)
             raise pm.ParameterError("Child must have no id")
         self.child.parent = self
         self.rwbc = RepeatingWidgetBunchCls(parent=self)
+        self.children = RepeatingWidgetBunch(self, self.rwbc)
 
     def __init__(self, **kw):
         super(RepeatingWidget, self).__init__(**kw)
-        self.children = RepeatingWidgetBunch(self, self.rwbc)
 
     def prepare(self):
         """