parameters: (treeType, implementation=None, **kwargs)
return_statement: return treeWalkerCache.get(treeType)
docstring: Get a TreeWalker class for various types of tree with built-in support
  
      treeType - the name of the tree type required (case-insensitive). Supported
                 values are:
  
                  "dom" - The xml.dom.minidom DOM implementation
                  "pulldom" - The xml.dom.pulldom event stream
                  "etree" - A generic walker for tree implementations exposing an
                            elementtree-like interface (known to work with
                            ElementTree, cElementTree and lxml.etree).
                  "lxml" - Optimized walker for lxml.etree
                  "genshi" - a Genshi stream
  
      implementation - (Currently applies to the "etree" tree type only). A module
                        implementing the tree type e.g. xml.etree.ElementTree or
                        cElementTree.
docstring_summary: Get a TreeWalker class for various types of tree with built-in support
docstring_tokens: Get a TreeWalker class for various types of tree with built - in support
function: def getTreeWalker(treeType, implementation=None, **kwargs):
      """Get a TreeWalker class for various types of tree with built-in support
  
      treeType - the name of the tree type required (case-insensitive). Supported
                 values are:
  
                  "dom" - The xml.dom.minidom DOM implementation
                  "pulldom" - The xml.dom.pulldom event stream
                  "etree" - A generic walker for tree implementations exposing an
                            elementtree-like interface (known to work with
                            ElementTree, cElementTree and lxml.etree).
                  "lxml" - Optimized walker for lxml.etree
                  "genshi" - a Genshi stream
  
      implementation - (Currently applies to the "etree" tree type only). A module
                        implementing the tree type e.g. xml.etree.ElementTree or
                        cElementTree."""
  
      treeType = treeType.lower()
      if treeType not in treeWalkerCache:
          if treeType in ("dom", "pulldom"):
              name = "%s.%s" % (__name__, treeType)
              __import__(name)
              mod = sys.modules[name]
              treeWalkerCache[treeType] = mod.TreeWalker
          elif treeType == "genshi":
              from . import genshistream
              treeWalkerCache[treeType] = genshistream.TreeWalker
          elif treeType == "lxml":
              from . import lxmletree
              treeWalkerCache[treeType] = lxmletree.TreeWalker
          elif treeType == "etree":
              from . import etree
              if implementation is None:
                  implementation = default_etree
              # XXX: NEVER cache here, caching is done in the etree submodule
              return etree.getETreeModule(implementation, **kwargs).TreeWalker
      return treeWalkerCache.get(treeType)
function_tokens: def getTreeWalker ( treeType , implementation = None , * * kwargs ) : treeType = treeType . lower ( ) if treeType not in treeWalkerCache : if treeType in ( "dom" , "pulldom" ) : name = "%s.%s" % ( __name__ , treeType ) __import__ ( name ) mod = sys . modules [ name ] treeWalkerCache [ treeType ] = mod . TreeWalker elif treeType == "genshi" : from . import genshistream treeWalkerCache [ treeType ] = genshistream . TreeWalker elif treeType == "lxml" : from . import lxmletree treeWalkerCache [ treeType ] = lxmletree . TreeWalker elif treeType == "etree" : from . import etree if implementation is None : implementation = default_etree # XXX: NEVER cache here, caching is done in the etree submodule return etree . getETreeModule ( implementation , * * kwargs ) . TreeWalker return treeWalkerCache . get ( treeType )