ó
]†Lc           @   s5   d  Z  d d l m Z d „  Z d „  Z d „  Z d S(   sÍ   
    markupsafe._native
    ~~~~~~~~~~~~~~~~~~

    Native Python implementation the C module is not compiled.

    :copyright: (c) 2010 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
iÿÿÿÿ(   t   Markupc         C   se   t  |  d ƒ r |  j ƒ  St t |  ƒ j d d ƒ j d d ƒ j d d ƒ j d d	 ƒ j d
 d ƒ ƒ S(   sÐ   Convert the characters &, <, >, ' and " in string s to HTML-safe
    sequences.  Use this if you need to display text that might contain
    such characters in HTML.  Marks return value as markup string.
    t   __html__t   &s   &amp;t   >s   &gt;t   <s   &lt;t   's   &#39;t   "s   &#34;(   t   hasattrR   R    t   unicodet   replace(   t   s(    (    s6   /usr/lib/python2.7/dist-packages/markupsafe/_native.pyt   escape   s    
c         C   s   |  d k r t ƒ  St |  ƒ S(   sM   Like :func:`escape` but converts `None` into an empty
    markup string.
    N(   t   NoneR    R   (   R
   (    (    s6   /usr/lib/python2.7/dist-packages/markupsafe/_native.pyt   escape_silent   s    c         C   s"   t  |  t ƒ s t |  ƒ }  n  |  S(   so   Make a string unicode if it isn't already.  That way a markup
    string is not converted back to unicode.
    (   t
   isinstanceR   (   R
   (    (    s6   /usr/lib/python2.7/dist-packages/markupsafe/_native.pyt   soft_unicode'   s    N(   t   __doc__t
   markupsafeR    R   R   R   (    (    (    s6   /usr/lib/python2.7/dist-packages/markupsafe/_native.pyt   <module>
   s   			