##// END OF EJS Templates
ILeo: LeoNode.__delitem__ and append(). Now clear() etc work
Ville M. Vainio -
Show More
@@ -254,6 +254,14 b' class LeoNode(object, UserDict.DictMixin):'
254 p = c.createLastChildNode(self.p, head, '')
254 p = c.createLastChildNode(self.p, head, '')
255 LeoNode(p).v = val
255 LeoNode(p).v = val
256
256
257 def __delitem__(self, key):
258 """ Remove child
259
260 Allows stuff like wb.foo.clear() to remove all children
261 """
262 self[key].p.doDelete()
263 c.redraw()
264
257 def ipush(self):
265 def ipush(self):
258 """ Does push-to-ipython on the node """
266 """ Does push-to-ipython on the node """
259 push_from_leo(self)
267 push_from_leo(self)
@@ -263,6 +271,12 b' class LeoNode(object, UserDict.DictMixin):'
263 c.setCurrentPosition(self.p)
271 c.setCurrentPosition(self.p)
264 c.redraw()
272 c.redraw()
265
273
274 def append(self):
275 """ Add new node as the last child, return the new node """
276 p = self.p.insertAsLastChild()
277 return LeoNode(p)
278
279
266 def script(self):
280 def script(self):
267 """ Method to get the 'tangled' contents of the node
281 """ Method to get the 'tangled' contents of the node
268
282
General Comments 0
You need to be logged in to leave comments. Login now