(self, node)
| 473 | return FILTER_ACCEPT |
| 474 | |
| 475 | def acceptNode(self, node): |
| 476 | mask = self._nodetype_mask[node.nodeType] |
| 477 | if self.filter.whatToShow & mask: |
| 478 | val = self.filter.acceptNode(node) |
| 479 | if val == FILTER_INTERRUPT: |
| 480 | raise ParseEscape |
| 481 | if val == FILTER_SKIP: |
| 482 | # move all child nodes to the parent, and remove this node |
| 483 | parent = node.parentNode |
| 484 | for child in node.childNodes[:]: |
| 485 | parent.appendChild(child) |
| 486 | # node is handled by the caller |
| 487 | return FILTER_REJECT |
| 488 | if val not in _ALLOWED_FILTER_RETURNS: |
| 489 | raise ValueError( |
| 490 | "acceptNode() returned illegal value: " + repr(val)) |
| 491 | return val |
| 492 | else: |
| 493 | return FILTER_ACCEPT |
| 494 | |
| 495 | _nodetype_mask = { |
| 496 | Node.ELEMENT_NODE: NodeFilter.SHOW_ELEMENT, |
no test coverage detected