ó
i4Vdc           @   s  d  Z  d d l m Z d d l m Z m Z d e f d „  ƒ  YZ d e e f d „  ƒ  YZ	 d e j
 e f d	 „  ƒ  YZ e j r‰ e Z n e	 Z e Z d
 e f d „  ƒ  YZ d e e f d „  ƒ  YZ d e j
 e f d „  ƒ  YZ e j rò e Z n e Z e Z d „  Z d „  Z d S(   s8  
Functions for working with "safe strings": strings that can be displayed safely
without further escaping in HTML. Marking something as a "safe string" means
that the producer of the string has already turned characters that should not
be interpreted by the HTML engine (e.g. '<') into the appropriate entities.
iÿÿÿÿ(   t   six(   t   Promiset   curryt
   EscapeDatac           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyR      s   t   EscapeBytesc           B   s   e  Z d  Z RS(   s@   
    A byte string that should be HTML-escaped when output.
    (   R   R   t   __doc__(    (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyR      s   t
   EscapeTextc           B   s   e  Z d  Z RS(   sJ   
    A unicode string object that should be HTML-escaped when output.
    (   R   R   R   (    (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyR      s   t   SafeDatac           B   s   e  Z d  „  Z RS(   c         C   s   |  S(   s    
        Returns the html representation of a string for interoperability.

        This allows other template engines to understand Django's SafeData.
        (    (   t   self(    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyt   __html__%   s    (   R   R   R   (    (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyR	   $   s   t	   SafeBytesc           B   s5   e  Z d  Z d „  Z d „  Z e e d e j ƒZ RS(   sƒ   
    A bytes subclass that has been specifically marked as "safe" (requires no
    further escaping) for HTML output purposes.
    c         C   sN   t  t |  ƒ j | ƒ } t | t ƒ r1 t | ƒ St | t ƒ rJ t | ƒ S| S(   s¡   
        Concatenating a safe byte string with another safe byte string or safe
        unicode string is safe. Otherwise, the result is no longer safe.
        (   t   superR   t   __add__t
   isinstancet   SafeText(   R
   t   rhst   t(    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyR   3   s    

c         O   sH   | j  d ƒ } | |  | | Ž } t | t ƒ r: t | ƒ St | ƒ Sd S(   s°   
        Wrap a call to a normal unicode method up so that we return safe
        results. The method that is being wrapped is passed in the 'method'
        argument.
        t   methodN(   t   popR   t   bytesR   R   (   R
   t   argst   kwargsR   t   data(    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyt   _proxy_method?   s
    
R   (   R   R   R   R   R   R   R   t   decode(    (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyR   .   s   		R   c           B   s8   e  Z d  Z d „  Z d „  Z e e d e j j ƒZ RS(   s‚   
    A unicode (Python 2) / str (Python 3) subclass that has been specifically
    marked as "safe" for HTML output purposes.
    c         C   s5   t  t |  ƒ j | ƒ } t | t ƒ r1 t | ƒ S| S(   s¤   
        Concatenating a safe unicode string with another safe byte string or
        safe unicode string is safe. Otherwise, the result is no longer safe.
        (   R   R   R   R   R	   (   R
   R   R   (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyR   T   s    
c         O   sH   | j  d ƒ } | |  | | Ž } t | t ƒ r: t | ƒ St | ƒ Sd S(   s°   
        Wrap a call to a normal unicode method up so that we return safe
        results. The method that is being wrapped is passed in the 'method'
        argument.
        R   N(   R   R   R   R   R   (   R
   R   R   R   R   (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyR   ^   s
    
R   (	   R   R   R   R   R   R   R    t	   text_typet   encode(    (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyR   O   s   	
	c         C   sv   t  |  d ƒ r |  St |  t ƒ s: t |  t ƒ rD |  j rD t |  ƒ St |  t j t f ƒ rf t |  ƒ St	 t
 |  ƒ ƒ S(   sÖ   
    Explicitly mark a string as safe for (HTML) output purposes. The returned
    object can be used everywhere a string or unicode object is appropriate.

    Can be called multiple times on a single string.
    R   (   t   hasattrR   R   R   t   _delegate_bytesR   R    R   R   t
   SafeStringt   str(   t   s(    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyt	   mark_safeu   s    '

c         C   s…   t  |  d ƒ s t |  t ƒ r" |  St |  t ƒ sI t |  t ƒ rS |  j rS t |  ƒ St |  t j t f ƒ ru t	 |  ƒ St
 t |  ƒ ƒ S(   sÜ   
    Explicitly mark a string as requiring HTML escaping upon output. Has no
    effect on SafeData subclasses.

    Can be called multiple times on a single string (the resulting escaping is
    only applied once).
    R   (   R   R   R   R   R   R   R   R    R   R   t   EscapeStringR    (   R!   (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyt   mark_for_escaping…   s    '

N(   R   t   django.utilsR    t   django.utils.functionalR   R   t   objectR   R   R   R   R   t   PY3R#   t   EscapeUnicodeR	   R   R   R   t   SafeUnicodeR"   R$   (    (    (    se   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/safestring.pyt   <module>   s$   		
!			