ReW@sdZddlmZmZmZddlmZddlmZddgZ iZ dd dZ d d Z d dZ dS) aA collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method which takes a tree as sole argument and returns an iterator which generates tokens. )absolute_importdivisionunicode_literals) constants) default_etree getTreeWalkerpprintNcKs|j}|tkr|dkrDddlm}|jt| rrz %s%s="%s"EndTagCommentz %sDoctypepublicIdz%ssystemIdrz%sz%sz %srz%s"%s"rFzBconcatenateCharacterTokens should have got rid of all Space tokenszUnknown token type, %s )r%r&) r$r namespacesprefixesrsorteditemsAssertionError ValueErrorr ) walkeroutputindentr#rnsr)attrsr' localnamevaluerrrr Psd  !    %"     "    "   " )__doc__ __future__rrrrr_utilsr__all__rrr$r rrrr s ,