%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyc

�
2�kSc@srdZddlZddlZddlmZddlmZmZmZm	Z	m
Z
mZddddgZej
d	�Zej
d
�Zdefd��YZdefd
��YZeed�r�dejfd��YZnd�Zdefd��YZy ddlmZmZmZWn-ek
rQddlmZmZmZnXesneZejd�ndS(s�
    markupsafe
    ~~~~~~~~~~

    Implements a Markup string.

    :copyright: (c) 2010 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
i����N(tMapping(t	text_typetstring_typest	int_typestunichrt	iteritemstPY2tMarkuptsoft_unicodetescapet
escape_silents(<!--.*?-->|<[^>]*>)s	&([^;]+);cBs|eZdZd)Zdd*dd�Zd�Zd�Zd�Zd�Z	e	Z
d�Zd	�Zd
�Z
ej
je
_d�Zejje_d�Zejje_d
�Zejje_d�Zd�Zed��Zd�Zx!d+D]Zee�e�e<q�Weed"�r2d#�Zd$�Zneed%�rVd&�Zd'�Zneed(�rted(�Zn[[RS(,sMarks a string as being safe for inclusion in HTML/XML output without
    needing to be escaped.  This implements the `__html__` interface a couple
    of frameworks and web applications use.  :class:`Markup` is a direct
    subclass of `unicode` and provides all the methods of `unicode` just that
    it escapes arguments passed and always returns `Markup`.

    The `escape` function returns markup objects so that double escaping can't
    happen.

    The constructor of the :class:`Markup` class can be used for three
    different things:  When passed an unicode object it's assumed to be safe,
    when passed an object with an HTML representation (has an `__html__`
    method) that representation is used, otherwise the object passed is
    converted into a unicode string and then assumed to be safe:

    >>> Markup("Hello <em>World</em>!")
    Markup(u'Hello <em>World</em>!')
    >>> class Foo(object):
    ...  def __html__(self):
    ...   return '<a href="#">foo</a>'
    ...
    >>> Markup(Foo())
    Markup(u'<a href="#">foo</a>')

    If you want object passed being always treated as unsafe you can use the
    :meth:`escape` classmethod to create a :class:`Markup` object:

    >>> Markup.escape("Hello <em>World</em>!")
    Markup(u'Hello &lt;em&gt;World&lt;/em&gt;!')

    Operations on a markup string are markup aware which means that all
    arguments are passed through the :func:`escape` function:

    >>> em = Markup("<em>%s</em>")
    >>> em % "foo & bar"
    Markup(u'<em>foo &amp; bar</em>')
    >>> strong = Markup("<strong>%(text)s</strong>")
    >>> strong % {'text': '<blink>hacker here</blink>'}
    Markup(u'<strong>&lt;blink&gt;hacker here&lt;/blink&gt;</strong>')
    >>> Markup("<em>Hello</em> ") + "<foo>"
    Markup(u'<em>Hello</em> &lt;foo&gt;')
    utstrictcCsPt|d�r|j�}n|dkr:tj||�Stj||||�S(Nt__html__(thasattrRtNoneRt__new__(tclstbasetencodingterrors((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRFs
cCs|S(N((tself((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRMscCsJt|t�st|d�rF|jtt|�j|j|���StS(NR(	t
isinstanceRR
t	__class__tsuperRt__add__R	tNotImplemented(Rtother((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRPs(cCs8t|d�st|t�r4|j|�j|�StS(NR(R
RRR	RR(RR((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyt__radd__UscCs,t|t�r(|jtj||��StS(N(RRRRt__mul__R(Rtnum((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRZscsYt|t�r.t�fd�|D��}nt|�j�}�jtj�|��S(Nc3s!|]}t|�j�VqdS(N(t_MarkupEscapeHelperR	(t.0tx(R(sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pys	<genexpr>bs(RttupleRR	RRt__mod__(Rtarg((RsF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR"`scCsd|jjtj|�fS(Ns%s(%s)(Rt__name__Rt__repr__(R((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR%gs	cCs%|jtj|t|j|���S(N(RRtjointmapR	(Rtseq((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR&mscOs%tt|jtj|||���S(N(tlistR'RRtsplit(Rtargstkwargs((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR*qscOs%tt|jtj|||���S(N(R)R'RRtrsplit(RR+R,((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR-uscOs%tt|jtj|||���S(N(R)R'RRt
splitlines(RR+R,((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR.yscs5ddlm��fd�}tj|t|��S(s�Unescape markup again into an text_type string.  This also resolves
        known HTML4 and XHTML entities:

        >>> Markup("Main &raquo; <em>About</em>").unescape()
        u'Main \xbb <em>About</em>'
        i����(t
HTML_ENTITIEScs�|jd�}|�kr)t�|�SyN|d dkrStt|dd��S|jd�rvtt|d��SWntk
r�nXdS(	Niis#xs#Xit#u(s#xs#X(tgroupRtintt
startswitht
ValueError(tmtname(R/(sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pythandle_match�s
(tmarkupsafe._constantsR/t
_entity_retsubR(RR7((R/sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pytunescape~scCs1djtjd|�j��}t|�j�S(sUnescape markup into an text_type string and strip all tags.  This
        also resolves known HTML4 and XHTML entities.  Whitespace is
        normalized to one:

        >>> Markup("Main &raquo;  <em>About</em>").striptags()
        u'Main \xbb About'
        u t(R&t
_striptags_reR:R*RR;(Rtstripped((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyt	striptags�s!cCs)t|�}|j|k	r%||�S|S(s�Escape the string.  Works like :func:`escape` with the difference
        that for subclasses of :class:`Markup` this function would return the
        correct subclass.
        (R	R(Rtstrv((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR	�s
cs:tt|���fd�}�j|_�j|_|S(NcsStt|�t|�|j�}t|t|�|j�|j�|||��S(N(t_escape_argspecR)t	enumerateR	RR(RR+R,(torig(sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pytfunc�s!(tgetattrRR$t__doc__(R6RE((RDsF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pytmake_simple_escaping_wrapper�s
t__getitem__t
capitalizettitletlowertuppertreplacetljusttrjusttlstriptrstriptcentertstript	translatet
expandtabstswapcasetzfillt	partitioncCs+tt|jtj||j|����S(N(R!R'RRRYR	(Rtsep((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRY�scCs+tt|jtj||j|����S(N(R!R'RRt
rpartitionR	(RRZ((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR[�stformatcOsO|d|d}}t|j�}t||�}|j|j|||��S(Nii(tEscapeFormatterR	t_MagicFormatMappingRtvformat(R+R,Rt	formatter((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR\�scCs|rtd��n|S(Ns,Unsupported format specification for Markup.(R4(Rtformat_spec((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyt__html_format__�st__getslice__(N(s__getitem__s
capitalizestitleslowersuppersreplacesljustsrjustslstripsrstripscentersstrips	translates
expandtabssswapcaseszfill(R$t
__module__RGt	__slots__RRRRRRt__rmul__R"R%R&RR*R-R.R;R?tclassmethodR	RHtmethodtlocalsR
RYR[R\RbRc(((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRsH*													

		R^cBs2eZdZd�Zd�Zd�Zd�ZRS(s�This class implements a dummy wrapper to fix a bug in the Python
    standard library for string formatting.

    See http://bugs.python.org/issue13598 for information about why
    this is necessary.
    cCs||_||_d|_dS(Ni(t_argst_kwargst_last_index(RR+R,((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyt__init__�s		cCsa|dkrV|j}|jd7_y|j|SWntk
rFnXt|�}n|j|S(NR<i(RlRjtLookupErrortstrRk(Rtkeytidx((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRI�s	
cCs
t|j�S(N(titerRk(R((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyt__iter__�scCs
t|j�S(N(tlenRk(R((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyt__len__�s(R$RdRGRmRIRsRu(((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR^�s
			R\R]cBseZd�Zd�ZRS(cCs
||_dS(N(R	(RR	((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRm�scCst|d�r!|j|�}nKt|d�rT|rEtd��n|j�}ntjj|||�}t|j|��S(NRbRsSNo format specification allowed when formatting an object with its __html__ method.(	R
RbR4Rtstringt	Formattertformat_fieldRR	(RtvalueRaRA((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRx�s(R$RdRmRx(((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR]�s	cCsLxE|D]=\}}t|d�s1t|t�r||�||<qqW|S(s,Helper for various string-wrapped functions.R(R
RR(tobjtiterableR	RpRy((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRBsRcBsHeZdZd�Zd�Zd�ZZd�Zd�Zd�Z	RS(sHelper for Markup.__mod__cCs||_||_dS(N(RzR	(RRzR	((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRms	cCst|j||j�S(N(RRzR	(R@R ((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyt<lambda>scCst|j|j��S(N(RR	Rz(R@((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR|scCst|jt|j���S(N(RoR	treprRz(R@((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR|scCs
t|j�S(N(R2Rz(R@((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR|scCs
t|j�S(N(tfloatRz(R@((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyR|s(
R$RdRGRmRIt__unicode__t__str__R%t__int__t	__float__(((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyRs		
		(R	R
Rtsoft_str( RGtreRvtcollectionsRtmarkupsafe._compatRRRRRRt__all__tcompileR=R9RR^R
RwR]RBtobjectRtmarkupsafe._speedupsR	R
RtImportErrortmarkupsafe._nativeR�tappend(((sF/opt/alt/python27/lib64/python2.7/site-packages/markupsafe/__init__.pyt<module>
s(.�	 
 

Zerion Mini Shell 1.0