Ñò
Ê¥WJc        	   @   sì   d  d k  l Z d  d k l Z d  d k l Z l Z l Z l Z l	 Z	 l
 Z
 l Z d  d k l Z d  d k Z d  d k l Z d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d „  Z d d d „ Z d „  Z d „  Z d „  Z d „  Z d S(   iÿÿÿÿ(   t
   quote_plus(   t   XML(   t   app_globalst   configt   sessiont   tmpl_contextt   requestt   responset
   templating(   t
   predicatesN(   t   Buncht   MissingRendererErrorc           B   s   e  Z d  „  Z RS(   c         C   s0   t  t |  ƒ i d t d | ƒ ƒ | |  _ d  S(   Ns£   The renderer for '%(template_engine)s' templates is missing. Try adding the following line in you app_cfg.py:
"base_config.renderers.append('%(template_engine)s')"t   template_engine(   t   superR   t   __init__t   dictR   (   t   selfR   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyR      s
    (   t   __name__t
   __module__R   (    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyR      s   t   DeprecatedFlashVariablec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   t   callablet   msg(   R   R   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyR      s    	c         C   s2   d d  k  } | i |  i t d ƒ t |  i ƒ  ƒ S(   Niÿÿÿÿi   (   t   warningst   warnR   t   DeprecationWarningt   unicodeR   (   R   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyt   __unicode__   s    c         C   s2   d d  k  } | i |  i t d ƒ t |  i ƒ  ƒ S(   Niÿÿÿÿi   (   R   R   R   R   t   boolR   (   R   R   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyt   __nonzero__   s    (   R   R   R   R   R   (    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyR      s   		c          C   sC  t  d t i d t i d t d „  d ƒ d t d „  d ƒ d	 t d
 t i d t i i	 d ƒ d t
 d t i i i ƒ  d t t d h  ƒ d t t d h  ƒ d t i d d t i i j d t ƒ }  t i	 d ƒ p t i	 d ƒ } t  d t d t d t d t d
 t i d | d |  ƒ } t i	 d d ƒ } | o | i | ƒ  ƒ n | S(    sÎ  Create a Bunch of variables that should be available in all templates.

    These variables are:

    WARNING: This function should not be called from outside of the render()
    code.  Please consider this function as private.

    quote_plus
        the urllib quote_plus function
    url
        the turbogears.url function for creating flexible URLs
    identity
        the current visitor's identity information
    session
        the current beaker.session if the session_filter.on it set
        in the app.cfg configuration file. If it is not set then session
        will be None.
    locale
        the default locale
    inputs
        input values from a form
    errors
        validation errors
    request
        the WebOb Request Object
    config
        the app's config object
    auth_stack_enabled
        A boolean that determines if the auth stack is present in the environment
    predicates
        The :mod:`repoze.what.predicates` module.

    R   t	   flash_objt   flashc           S   s
   t  i i S(    (   t   tgR   t   message(    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyt   <lambda>K   s    sb   flash is deprecated, please use flash_obj.message instead or use the new flash_obj.render() methodt   flash_statusc           S   s   d  t  i i S(   t   status_(   R   R   t   status(    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyR!   P   s    sh   flash_status is deprecated, please use flash_obj.status instead or use the new flash_obj.render() methodR    t   urlt   identitys   repoze.who.identityR   t   localet   errorst   form_errorst   inputst   form_valuesR   t   auth_stack_enableds   repoze.who.pluginsR	   s   pylons.hs   pylons.helperst   cR   R   t   helpersR   t   variable_providerN(   R
   R   R   R   R   R    R%   R   t   environt   getR   t   accept_languaget   best_matchest   getattrR   R	   R   t   Nonet   update(   t   tg_varsR.   t	   root_varsR/   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyt   _get_tg_vars$   s@    #									c         K   s›   | d  j	 o4 t d i | ƒ } | d  j o t | ƒ ‚ qA n |  p
 h  }  n t ƒ  } | i |  ƒ | }  | p t d t d } n | | |  |  S(   Nt   render_functionst   default_renderer(   R5   R   R1   R   R9   R6   (   t   template_varsR   t   template_namet   kwargst   render_functionR7   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyt   renderu   s    
	c         K   sV   t  | d <t i d t ƒ o# t i d i i |  d d ƒ}  n t i |  d | | S(   s;   Render the template_vars with the chameleon.genshi templateR   t   use_dotted_templatenamess   pylons.app_globalst   template_extensions   .htmlt
   extra_vars(	   R   R   R1   t   FalseR   t   dotted_filename_findert   get_dotted_filenameR   t   render_genshi(   R=   R<   R>   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyt   render_chameleon_genshi   s    
c         K   sV   t  | d <t i d t ƒ o# t i d i i |  d d ƒ}  n t i |  d | | S(   s1   Render the template_vars with the Genshi templateR   RA   s   pylons.app_globalsRB   s   .htmlRC   (	   R   R   R1   RD   R   RE   RF   R   RG   (   R=   R<   R>   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyRG      s    
c         K   sL   t  i d t ƒ o# t i  d i i |  d d ƒ}  n t i |  d | | S(   NRA   s   pylons.app_globalsRB   s   .makRC   (   R   R1   RD   R   RE   RF   R   t   render_mako(   R=   R<   R>   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyRI   «   s    c         K   s   t  i |  d | | S(   NRC   (   R   t   render_jinja2(   R=   R<   R>   (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyt   render_jinjaµ   s    (   t   urllibR    t   genshiR   t   pylonsR   R   R   R   R   R   R   t   repoze.whatR	   R   t   tg.configurationR
   t	   ExceptionR   t   objectR   R9   R5   R@   RH   RG   RI   RK   (    (    (    sg   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/render.pyt   <module>   s   4		Q			
