ó
®ā0_c           @  są   d  d l  m Z d  d l 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 y d  d	 l m Z Wn e k
 r d Z n Xe j d
 e  d e f d     YZ d e f d     YZ d S(   i’’’’(   t   unicode_literalsN(   t   apps(   t   Origint   TemplateDoesNotExist(   t   six(   t   RemovedInDjango20Warningi   (   t   Loader(   t   resource_stringu&   The egg template loader is deprecated.t	   EggOriginc           B  s   e  Z d    Z RS(   c         O  s/   | |  _  | |  _ t t |   j | |   d  S(   N(   t   app_namet   pkg_namet   superR   t   __init__(   t   selfR	   R
   t   argst   kwargs(    (    s>   /tmp/pip-unpacked-wheel-BAJOf3/django/template/loaders/eggs.pyR      s    		(   t   __name__t
   __module__R   (    (    (    s>   /tmp/pip-unpacked-wheel-BAJOf3/django/template/loaders/eggs.pyR      s   R   c           B  s/   e  Z d    Z d   Z d   Z d d  Z RS(   c         C  s5   t  d  k r t d   n  t t |   j |  d  S(   Nu2   Setuptools must be installed to use the egg loader(   R   t   Nonet   RuntimeErrorR   R   R   (   R   t   engine(    (    s>   /tmp/pip-unpacked-wheel-BAJOf3/django/template/loaders/eggs.pyR      s    c         C  s^   y t  | j | j  } Wn t k
 r8 t |   n Xt j rZ | j |  j j	  } n  | S(   N(
   R   R	   R
   t	   ExceptionR   R   t   PY2t   decodeR   t   file_charset(   R   t   origint   source(    (    s>   /tmp/pip-unpacked-wheel-BAJOf3/django/template/loaders/eggs.pyt   get_contents$   s    	c         c  s[   d | } xJ t  j   D]< } t d | j d | d d | j | f d | d |   Vq Wd  S(   Nu
   templates/R	   R
   t   nameu	   egg:%s:%st   template_namet   loader(   R   t   get_app_configsR   R   (   R   R   R
   t
   app_config(    (    s>   /tmp/pip-unpacked-wheel-BAJOf3/django/template/loaders/eggs.pyt   get_template_sources/   s    
	c         C  sh   t  j d t  xE |  j |  D]4 } y |  j |  | j f SWq  t k
 rS q  Xq  Wt |   d S(   u©   
        Loads templates from Python eggs via pkg_resource.resource_string.

        For every installed app, it tries to get the resource (app, template_name).
        u_   The load_template_sources() method is deprecated. Use get_template() or get_contents() instead.N(   t   warningst   warnR   R!   R   R   R   (   R   R   t   template_dirsR   (    (    s>   /tmp/pip-unpacked-wheel-BAJOf3/django/template/loaders/eggs.pyt   load_template_source:   s    N(   R   R   R   R   R!   R   R%   (    (    (    s>   /tmp/pip-unpacked-wheel-BAJOf3/django/template/loaders/eggs.pyR      s   			(   t
   __future__R    R"   t   django.appsR   t   django.templateR   R   t   django.utilsR   t   django.utils.deprecationR   t   baseR   t
   BaseLoadert   pkg_resourcesR   t   ImportErrorR   R#   R   (    (    (    s>   /tmp/pip-unpacked-wheel-BAJOf3/django/template/loaders/eggs.pyt   <module>   s   
