3
PfL @ s d dl mZmZmZ yd dlmZ W n> ek
rb yd dlmZ W n ek
r\ eZY nX Y nX d dl Z d dl
mZ ddlm
Z
ddlmZ e jd Zd
d ZeeZdS ) )absolute_importdivisionunicode_literals)OrderedDictN)string_types )base )moduleFactoryFactoryz
{([^}]*)}(.*)c s, | }|j dj G fdddtj}t S )NZasdc s4 e Zd ZdZ fddZdd Zdd Zdd Zd
S )z#getETreeBuilder..TreeWalkera Given the particular ElementTree representation, this implementation,
to avoid using recursion, returns "nodes" as tuples with the following
content:
1. The current element
2. The index of the element relative to its parent
3. A stack of ancestor elements
4. A flag "text", "tail" or None to indicate if the current node is a
text node; either the text or tail of the current element (1)
c s2 t |tr2|\}}}}|dkr.tjt||fS |}t|dsD|j }|jdkrVtjfS |jdkr|tj |j
|jd|jdfS |j krtj|j
fS t
j|j}|r|j \}}n
d }|j}t }xPt|jj D ]>\} }
t
j| }|r|
||jd |jd
f<