
 X                 @   sb   d  d l  Z  d  d l m Z m Z m Z d  d l m Z d  d l m Z Gd d   d e	  Z
 d S)    N)OriginTemplateTemplateDoesNotExist)RemovedInDjango20Warning)func_supports_parameterc               @   s   e  Z d  Z d d   Z d d d  Z d d d d  Z d d d	  Z d
 d   Z d d d  Z d d   Z	 e
 d d    Z d S)Loaderc             C   s   | |  _  d  S)N)engine)selfr    r
   J/home/ubuntu/projects/ifolica/build/django/django/template/loaders/base.py__init__
   s    zLoader.__init__Nc             C   s   |  j  | |  S)N)load_template)r	   template_nametemplate_dirsr
   r
   r   __call__   s    zLoader.__call__c             C   s   g  } | g } t  |  j d  r1 | j |  n  x |  j |   D] } | d k	 rx | | k rx | j | d f  qA n  y |  j |  } Wn( t k
 r | j | d f  wA YqA Xt | | | j |  j  SqA Wt | d |  d S)a  
        Calls self.get_template_sources() and returns a Template object for
        the first template matching template_name. If skip is provided,
        template origins in skip are ignored. This is used to avoid recursion
        during template extending.
        r   NZSkippedzSource does not existtried)r   get_template_sourcesappendget_contentsr   r   r   r   )r	   r   r   skipr   argsorigincontentsr
   r
   r   get_template   s     	zLoader.get_templatec             C   s   t  j d t  |  j | |  \ } } t d | d | d |   } y t | | | |  j  } Wn t k
 r} | | f SYn X| d  f Sd  S)NzEThe load_template() method is deprecated. Use get_template() instead.namer   loader)warningswarnr   load_template_sourcer   r   r   r   )r	   r   r   sourceZdisplay_namer   templater
   r
   r   r   1   s    	zLoader.load_templatec             C   s   t  d   d S)zg
        An iterator that yields possible matching template paths for a
        template name.
        zAsubclasses of Loader must provide a get_template_sources() methodN)NotImplementedError)r	   r   r
   r
   r   r   I   s    zLoader.get_template_sourcesc             C   s   t  d   d S)z
        RemovedInDjango20Warning: Returns a tuple containing the source and
        origin for the given template name.
        zAsubclasses of Loader must provide a load_template_source() methodN)r!   )r	   r   r   r
   r
   r   r   R   s    zLoader.load_template_sourcec             C   s   d S)z~
        Resets any state maintained by the loader instance (e.g. cached
        templates or cached loader modules).
        Nr
   )r	   r
   r
   r   reset[   s    zLoader.resetc             C   s   t  |  d  S)z
        RemovedInDjango20Warning: This is an internal property used by the
        ExtendsNode during the deprecation of non-recursive loaders.
        r   )hasattr)r	   r
   r
   r   supports_recursionb   s    zLoader.supports_recursion)__name__
__module____qualname__r   r   r   r   r   r   r"   propertyr$   r
   r
   r
   r   r      s    		r   )r   Zdjango.templater   r   r   Zdjango.utils.deprecationr   Zdjango.utils.inspectr   objectr   r
   r
   r
   r   <module>   s   