Ńň
Ż×ßGc           @   sÂ   d  Z  d d k l Z l Z d e f d     YZ d e e f d     YZ d e e f d     YZ	 d	 e f d
     YZ
 d e e
 f d     YZ d e e
 f d     YZ 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   curryt   Promiset
   EscapeDatac           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyR   	   s   t   EscapeStringc           B   s   e  Z d  Z RS(   s;   
    A string that should be HTML-escaped when output.
    (   R   R   t   __doc__(    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyR      s   t   EscapeUnicodec           B   s   e  Z d  Z RS(   sC   
    A unicode object that should be HTML-escaped when output.
    (   R   R   R   (    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyR      s   t   SafeDatac           B   s   e  Z RS(    (   R   R   (    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyR      s   t
   SafeStringc           B   s5   e  Z d  Z d   Z d   Z e e d e i Z RS(   s   
    A string subclass that has been specifically marked as "safe" (requires no
    further escaping) for HTML output purposes.
    c         C   sR   t  t |   i |  } t | t  o t |  St | t  o t |  S| S(   s   
        Concatenating a safe string with another safe string or safe unicode
        object is safe. Otherwise, the result is no longer safe.
        (   t   superR	   t   __add__t
   isinstancet   SafeUnicode(   t   selft   rhst   t(    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyR       s    c         O   sJ   | i  d  } | |  | |  } t | t  o t |  St |  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   strR	   R   (   R   t   argst   kwargsR   t   data(    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyt   _proxy_method,   s
    R   (   R   R   R   R   R   R    R   t   decode(    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyR	      s   		R   c           B   s5   e  Z d  Z d   Z d   Z e e d e i Z RS(   sf   
    A unicode subclass that has been specifically marked as "safe" for HTML
    output purposes.
    c         C   s7   t  t |   i |  } t | t  o t |  S| S(   s   
        Concatenating a safe unicode object with another safe string or safe
        unicode object is safe. Otherwise, the result is no longer safe.
        (   R
   R   R   R   R   (   R   R   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyR   @   s    c         O   sJ   | i  d  } | |  | |  } t | t  o t |  St |  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   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyR   J   s
    R   (   R   R   R   R   R   R    t   unicodet   encode(    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyR   ;   s   	
	c         C   s{   t  |  t  o |  St  |  t  p t  |  t  o |  i o t |   St  |  t t f  o t |   St 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   R   R   R   t   _delegate_strR	   R   R   (   t   s(    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyt	   mark_safeY   s    *c         C   s   t  |  t t f  o |  St  |  t  p t  |  t  o |  i o t |   St  |  t t f  o t |   St 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   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyt   mark_for_escapingh   s    *N(   R   t   django.utils.functionalR    R   t   objectR   R   R   R   R   R   R	   R   R   R   (    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/safestring.pyt   <module>   s    	