Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Attributes | List of all members
docutils.nodes.Node Class Reference
Inheritance diagram for docutils.nodes.Node:
Inheritance graph
[legend]

Public Member Functions

 document (self)
 
 document (self, value)
 
 __bool__ (self)
 
 asdom (self, dom=None)
 
 pformat (self, indent=' ', level=0)
 
 copy (self)
 
 deepcopy (self)
 
 astext (self)
 
 setup_child (self, child)
 
 walk (self, visitor)
 
 walkabout (self, visitor)
 
 traverse (self, condition=None, include_self=True, descend=True, siblings=False, ascend=False)
 
 findall (self, condition=None, include_self=True, descend=True, siblings=False, ascend=False)
 
 next_node (self, condition=None, include_self=False, descend=True, siblings=False, ascend=False)
 

Public Attributes

 children
 

Static Public Attributes

 parent = None
 
 source = None
 
 line = None
 

Protected Member Functions

 _fast_findall (self, cls)
 
 _superfast_findall (self)
 

Static Protected Attributes

 _document = None
 

Detailed Description

Abstract base class of nodes in a document tree.

Member Function Documentation

◆ __bool__()

docutils.nodes.Node.__bool__ (   self)
Node instances are always true, even if they're empty.  A node is more
than a simple container.  Its boolean "truth" does not depend on
having one or more subnodes in the doctree.

Use `len()` to check node length.

◆ _fast_findall()

docutils.nodes.Node._fast_findall (   self,
  cls 
)
protected
Return iterator that only supports instance checks.

◆ _superfast_findall()

docutils.nodes.Node._superfast_findall (   self)
protected
Return iterator that doesn't check for a condition.

◆ asdom()

docutils.nodes.Node.asdom (   self,
  dom = None 
)
Return a DOM **fragment** representation of this Node.

Reimplemented in docutils.nodes.document.

◆ astext()

docutils.nodes.Node.astext (   self)

◆ copy()

docutils.nodes.Node.copy (   self)

◆ deepcopy()

docutils.nodes.Node.deepcopy (   self)
Return a deep copy of self (also copying children).

Reimplemented in docutils.nodes.Text, and docutils.nodes.Element.

◆ document()

docutils.nodes.Node.document (   self)
Return the `document` root node of the tree containing this Node.

◆ findall()

docutils.nodes.Node.findall (   self,
  condition = None,
  include_self = True,
  descend = True,
  siblings = False,
  ascend = False 
)
Return an iterator yielding nodes following `self`:

* self (if `include_self` is true)
* all descendants in tree traversal order (if `descend` is true)
* the following siblings (if `siblings` is true) and their
  descendants (if also `descend` is true)
* the following siblings of the parent (if `ascend` is true) and
  their descendants (if also `descend` is true), and so on.

If `condition` is not None, the iterator yields only nodes
for which ``condition(node)`` is true.  If `condition` is a
node class ``cls``, it is equivalent to a function consisting
of ``return isinstance(node, cls)``.

If `ascend` is true, assume `siblings` to be true as well.

If the tree structure is modified during iteration, the result
is undefined.

For example, given the following tree::

    <paragraph>
        <emphasis>      <--- emphasis.traverse() and
            <strong>    <--- strong.traverse() are called.
                Foo
            Bar
        <reference name="Baz" refid="baz">
            Baz

Then tuple(emphasis.traverse()) equals ::

    (<emphasis>, <strong>, <#text: Foo>, <#text: Bar>)

and list(strong.traverse(ascend=True) equals ::

    [<strong>, <#text: Foo>, <#text: Bar>, <reference>, <#text: Baz>]

◆ next_node()

docutils.nodes.Node.next_node (   self,
  condition = None,
  include_self = False,
  descend = True,
  siblings = False,
  ascend = False 
)
Return the first node in the iterator returned by findall(),
or None if the iterable is empty.

Parameter list is the same as of `findall()`.  Note that `include_self`
defaults to False, though.

◆ pformat()

docutils.nodes.Node.pformat (   self,
  indent = '    ',
  level = 0 
)
Return an indented pseudo-XML representation, for test purposes.

Override in subclasses.

Reimplemented in docutils.nodes.Text, docutils.nodes.Element, and docutils.nodes.pending.

◆ traverse()

docutils.nodes.Node.traverse (   self,
  condition = None,
  include_self = True,
  descend = True,
  siblings = False,
  ascend = False 
)
Return list of nodes following `self`.

For looping, Node.findall() is faster and more memory efficient.

◆ walk()

docutils.nodes.Node.walk (   self,
  visitor 
)
Traverse a tree of `Node` objects, calling the
`dispatch_visit()` method of `visitor` when entering each
node.  (The `walkabout()` method is similar, except it also
calls the `dispatch_departure()` method before exiting each
node.)

This tree traversal supports limited in-place tree
modifications.  Replacing one node with one or more nodes is
OK, as is removing an element.  However, if the node removed
or replaced occurs after the current node, the old node will
still be traversed, and any new nodes will not.

Within ``visit`` methods (and ``depart`` methods for
`walkabout()`), `TreePruningException` subclasses may be raised
(`SkipChildren`, `SkipSiblings`, `SkipNode`, `SkipDeparture`).

Parameter `visitor`: A `NodeVisitor` object, containing a
``visit`` implementation for each `Node` subclass encountered.

Return true if we should stop the traversal.

◆ walkabout()

docutils.nodes.Node.walkabout (   self,
  visitor 
)
Perform a tree traversal similarly to `Node.walk()` (which
see), except also call the `dispatch_departure()` method
before exiting each node.

Parameter `visitor`: A `NodeVisitor` object, containing a
``visit`` and ``depart`` implementation for each `Node`
subclass encountered.

Return true if we should stop the traversal.

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