Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
pydoc.Scanner Class Reference

List of all members.

Public Member Functions

def __init__
def next

Public Attributes

 roots
 state
 children
 descendp

Detailed Description

A generic tree iterator.

Definition at line 1952 of file pydoc.py.


Constructor & Destructor Documentation

def pydoc.Scanner.__init__ (   self,
  roots,
  children,
  descendp 
)

Definition at line 1954 of file pydoc.py.

01954 
01955     def __init__(self, roots, children, descendp):
01956         self.roots = roots[:]
01957         self.state = []
01958         self.children = children
01959         self.descendp = descendp

Here is the caller graph for this function:


Member Function Documentation

def pydoc.Scanner.next (   self)

Definition at line 1960 of file pydoc.py.

01960 
01961     def next(self):
01962         if not self.state:
01963             if not self.roots:
01964                 return None
01965             root = self.roots.pop(0)
01966             self.state = [(root, self.children(root))]
01967         node, children = self.state[-1]
01968         if not children:
01969             self.state.pop()
01970             return self.next()
01971         child = children.pop(0)
01972         if self.descendp(child):
01973             self.state.append((child, self.children(child)))
01974         return child
01975 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1957 of file pydoc.py.

Definition at line 1958 of file pydoc.py.

Definition at line 1955 of file pydoc.py.

Definition at line 1956 of file pydoc.py.


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