##// 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 254 p = c.createLastChildNode(self.p, head, '')
255 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 265 def ipush(self):
258 266 """ Does push-to-ipython on the node """
259 267 push_from_leo(self)
@@ -263,6 +271,12 b' class LeoNode(object, UserDict.DictMixin):'
263 271 c.setCurrentPosition(self.p)
264 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 280 def script(self):
267 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