Insert an L{Element} content at the specified index. @param objects: A (single|collection) of attribute(s) or element(s) to be added as children. @type objects: (L{Element}|L{Attribute}) @param index: The position in the list of children to insert.
(self, objects, index=0)
| 333 | return self |
| 334 | |
| 335 | def insert(self, objects, index=0): |
| 336 | """ |
| 337 | Insert an L{Element} content at the specified index. |
| 338 | @param objects: A (single|collection) of attribute(s) or element(s) |
| 339 | to be added as children. |
| 340 | @type objects: (L{Element}|L{Attribute}) |
| 341 | @param index: The position in the list of children to insert. |
| 342 | @type index: int |
| 343 | @return: self |
| 344 | @rtype: L{Element} |
| 345 | """ |
| 346 | objects = (objects,) |
| 347 | for child in objects: |
| 348 | if isinstance(child, Element): |
| 349 | self.children.insert(index, child) |
| 350 | child.parent = self |
| 351 | else: |
| 352 | raise Exception('append %s not-valid' % child.__class__.__name__) |
| 353 | return self |
| 354 | |
| 355 | def remove(self, child): |
| 356 | """ |
no outgoing calls
no test coverage detected