Package docutils :: Module nodes :: Class pending
[show private | hide private]
[frames | no frames]

Class pending

         Node --+    
                |    
          Element --+
                    |
        Invisible --+
                    |
PreDecorative --+   |
                |   |
 PreBibliographic --+
                    |
         Body --+   |
                |   |
          Special --+
                    |
                   pending


The "pending" element is used to encapsulate a pending operation: the operation (transform), the point at which to apply it, and any data it requires. Only the pending operation's location within the document is stored in the public document tree (by the "pending" object itself); the operation and its data are stored in the "pending" object's internal instance attributes.

For example, say you want a table of contents in your reStructuredText document. The easiest way to specify where to put it is from within the document, with a directive:

.. contents::

But the "contents" directive can't do its work until the entire document has been parsed and possibly transformed to some extent. So the directive code leaves a placeholder behind that will trigger the second phase of the its processing, something like this:

<pending ...public attributes...> + internal attributes

Use document.note_pending() so that the docutils.transforms.Transformer stage of processing can run all pending transforms.


Method Summary
  __init__(self, transform, details, rawsource, *children, **attributes)
  copy(self)
Return a copy of self.
  pformat(self, indent, level)
Return an indented pseudo-XML representation, for test purposes.
    Inherited from Element
  __add__(self, other)
  __delitem__(self, key)
  __getitem__(self, key)
  __iadd__(self, other)
Append a node or a list of nodes to self.children.
  __len__(self)
  __radd__(self, other)
  __repr__(self)
  __setitem__(self, key, item)
  __str__(self)
  __unicode__(self)
  append(self, item)
  astext(self)
  attlist(self)
  delattr(self, attr)
  emptytag(self)
  endtag(self)
  extend(self, item)
  first_child_matching_class(self, childclass, start, end)
Return the index of the first child whose class exactly matches.
  first_child_not_matching_class(self, childclass, start, end)
Return the index of the first child whose class does not match.
  get(self, key, failobj)
  get_children(self)
Return this element's children.
  has_key(self, attr)
  hasattr(self, attr)
  index(self, item)
  insert(self, index, item)
  pop(self, i)
  remove(self, item)
  replace(self, old, new)
Replace one child Node with another child or children.
  set_class(self, name)
Add a new name to the "class" attribute.
  setdefault(self, key, failobj)
  shortrepr(self)
  starttag(self)
  _dom_node(self, domroot)
    Inherited from Node
  __nonzero__(self)
Node instances are always true, even if they're empty.
  asdom(self, dom)
Return a DOM fragment representation of this Node.
  setup_child(self, child)
  walk(self, visitor)
Traverse a tree of Node objects, calling visit_... methods of visitor when entering each node.
  walkabout(self, visitor)
Perform a tree traversal similarly to Node.walk() (which see), except also call depart_... methods before exiting each node.

Class Variable Summary
    Inherited from Element
str child_text_separator = '\n\n'
NoneType tagname = None                                                                  
    Inherited from Node
NoneType document = None                                                                  
NoneType line = None                                                                  
NoneType parent = None                                                                  
NoneType source = None                                                                  

Method Details

copy(self)

Return a copy of self.
Overrides:
docutils.nodes.Element.copy (inherited documentation)

pformat(self, indent='    ', level=0)

Return an indented pseudo-XML representation, for test purposes.
Overrides:
docutils.nodes.Element.pformat (inherited documentation)

Generated by Epydoc 2.0 on Tue Jul 22 05:31:15 2003 http://epydoc.sf.net