�
�Udac @` s� d d l m Z m Z m Z e Z d d l m Z d d l m Z m
Z
d d l m Z d d l
m Z d d l m Z d g Z d e f d � � YZ d S(
i ( t absolute_importt divisiont print_function( t missing( t AnsibleErrort AnsibleUndefinedVariable( t iteritems( t to_native( t Mappingt
AnsibleJ2Varsc B` sG e Z d Z d d � Z d � Z d � Z d � Z d � Z d � Z RS( s�
Helper class to template all variable content before jinja2 sees it. This is
done by hijacking the variable storage that jinja2 uses, and overriding __contains__
and __getitem__ to look like a dict. Added bonus is avoiding duplicating the large
hashes that inject tends to be.
To facilitate using builtin jinja2 things like range, globals are also handled here.
c C` s� | | _ | | _ t � | _ t | t � r� xl t | � D][ \ } } | t k r: | d d k rv | | j | d <q� | d k r� | | j | <q� q: q: Wn d S( s�
Initializes this object with a valid Templar() object, as
well as several dictionaries of variables representing
different scopes (in jinja2 terminology).
i t l_t contextt environmentt templateN( R R s template( t _templart _globalst dictt _localst
isinstanceR R ( t selft templart globalst localst keyt val( ( s9 /usr/lib/python2.7/site-packages/ansible/template/vars.pyt __init__+ s c C` s@ | | j k r t S| | j j k r) t S| | j k r<