Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Private Attributes
xml.dom.expatbuilder.FilterVisibilityController Class Reference
Inheritance diagram for xml.dom.expatbuilder.FilterVisibilityController:
Inheritance graph
Collaboration diagram for xml.dom.expatbuilder.FilterVisibilityController:
Collaboration graph

List of all members.

Public Member Functions

def __init__
def startContainer
def acceptNode

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Private Attributes

string __slots__ = 'filter'
dictionary _nodetype_mask

Detailed Description

Wrapper around a DOMBuilderFilter which implements the checks
to make the whatToShow filter attribute work.

Definition at line 463 of file

Constructor & Destructor Documentation

Definition at line 469 of file

00470     def __init__(self, filter):
00471         self.filter = filter

Here is the caller graph for this function:

Member Function Documentation

Definition at line 485 of file

00486     def acceptNode(self, node):
00487         mask = self._nodetype_mask[node.nodeType]
00488         if self.filter.whatToShow & mask:
00489             val = self.filter.acceptNode(node)
00490             if val == FILTER_INTERRUPT:
00491                 raise ParseEscape
00492             if val == FILTER_SKIP:
00493                 # move all child nodes to the parent, and remove this node
00494                 parent = node.parentNode
00495                 for child in node.childNodes[:]:
00496                     parent.appendChild(child)
00497                 # node is handled by the caller
00498                 return FILTER_REJECT
00499             if val not in _ALLOWED_FILTER_RETURNS:
00500                 raise ValueError(
00501                       "acceptNode() returned illegal value: " + repr(val))
00502             return val
00503         else:
00504             return FILTER_ACCEPT

Definition at line 472 of file

00473     def startContainer(self, node):
00474         mask = self._nodetype_mask[node.nodeType]
00475         if self.filter.whatToShow & mask:
00476             val = self.filter.startContainer(node)
00477             if val == FILTER_INTERRUPT:
00478                 raise ParseEscape
00479             if val not in _ALLOWED_FILTER_RETURNS:
00480                 raise ValueError(
00481                       "startContainer() returned illegal value: " + repr(val))
00482             return val
00483         else:
00484             return FILTER_ACCEPT

Member Data Documentation

Definition at line 467 of file

Initial value:
        Node.ELEMENT_NODE:                NodeFilter.SHOW_ELEMENT,
        Node.ATTRIBUTE_NODE:              NodeFilter.SHOW_ATTRIBUTE,
        Node.TEXT_NODE:                   NodeFilter.SHOW_TEXT,
        Node.CDATA_SECTION_NODE:          NodeFilter.SHOW_CDATA_SECTION,
        Node.ENTITY_NODE:                 NodeFilter.SHOW_ENTITY,
        Node.COMMENT_NODE:                NodeFilter.SHOW_COMMENT,
        Node.DOCUMENT_NODE:               NodeFilter.SHOW_DOCUMENT,
        Node.DOCUMENT_TYPE_NODE:          NodeFilter.SHOW_DOCUMENT_TYPE,
        Node.NOTATION_NODE:               NodeFilter.SHOW_NOTATION,

Definition at line 505 of file

Definition at line 470 of file

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

The documentation for this class was generated from the following file: