ó
~9Vc           @   sØ   d  Z  d d l m Z d d l m Z m Z d   Z d   Z d   Z e   Z	 e   Z
 e e  Z e e e d   Z e e e d   Z e e e d	   Z d
 S(   sŪ   
    flask.globals
    ~~~~~~~~~~~~~

    Defines all the global objects that are proxies to the current
    active context.

    :copyright: (c) 2011 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
i’’’’(   t   partial(   t
   LocalStackt
   LocalProxyc         C   s1   t  j } | d  k r$ t d   n  t | |   S(   Ns"   working outside of request context(   t   _request_ctx_stackt   topt   Nonet   RuntimeErrort   getattr(   t   nameR   (    (    s,   /tmp/pip-build-zHWFj_/Flask/flask/globals.pyt   _lookup_req_object   s    	c         C   s1   t  j } | d  k r$ t d   n  t | |   S(   Ns&   working outside of application context(   t   _app_ctx_stackR   R   R   R   (   R   R   (    (    s,   /tmp/pip-build-zHWFj_/Flask/flask/globals.pyt   _lookup_app_object   s    	c          C   s+   t  j }  |  d  k r$ t d   n  |  j S(   Ns&   working outside of application context(   R
   R   R   R   t   app(   R   (    (    s,   /tmp/pip-build-zHWFj_/Flask/flask/globals.pyt	   _find_app   s    	t   requestt   sessiont   gN(   t   __doc__t	   functoolsR    t   werkzeug.localR   R   R	   R   R   R   R
   t   current_appR   R   R   (    (    (    s,   /tmp/pip-build-zHWFj_/Flask/flask/globals.pyt   <module>   s   					