404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.116.81.110: ~ $
3

2�kSb(�@sdZddlZddlZddlmZddlmZmZmZm	Z	m
Z
mZddddgZej
d	�Zej
d
�ZGdd�de�ZGdd
�d
e�Zeed�r�Gdd�dej�Zdd�ZGdd�de�ZyddlmZmZmZWn(ek
r�ddlmZmZmZYnXe�s
eZejd�dS)z�
    markupsafe
    ~~~~~~~~~~

    Implements a Markup string.

    :copyright: (c) 2010 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
�N)�Mapping)�	text_type�string_types�	int_types�unichr�	iteritems�PY2�Markup�soft_unicode�escape�
escape_silentz(<!--.*?-->|<[^>]*>)z	&([^;]+);cs2eZdZdZfZd>dd�Zdd�Z�fd	d
�Zdd�Zd
d�Z	e	Z
dd�Zdd�Zdd�Z
ej
je
_dd�Zejje_dd�Zejje_dd�Zejje_dd�Zdd�Zedd ��Zd!d"�Zxd?D]Zee�e�e<q�Weed3��r�d4d5�Zd6d7�Zeed8��rd9d:�Zd;d<�Zeed=��r&ed=�Z[[�ZS)@r	aMarks 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;')
    �N�strictcCs6t|d�r|j�}|dkr&tj||�Stj||||�S)N�__html__)�hasattrrr�__new__)�cls�base�encoding�errors�r� /usr/lib64/python3.6/__init__.pyrFs

zMarkup.__new__cCs|S)Nr)�selfrrrrMszMarkup.__html__cs4t|t�st|d�r0|jtt|�j|j|���StS)Nr)	�
isinstancerr�	__class__�superr	�__add__r�NotImplemented)r�other)rrrrPszMarkup.__add__cCs(t|d�st|t�r$|j|�j|�StS)Nr)rrrrrr)rrrrr�__radd__UszMarkup.__radd__cCs t|t�r|jtj||��StS)N)rrrr�__mul__r)rZnumrrrr Zs
zMarkup.__mul__cs@t|t�r"t�fdd�|D��}nt|�j�}�jtj�|��S)Nc3s|]}t|�j�VqdS)N)�_MarkupEscapeHelperr)�.0�x)rrr�	<genexpr>bsz!Markup.__mod__.<locals>.<genexpr>)r�tupler!rrr�__mod__)r�argr)rrr&`s
zMarkup.__mod__cCsd|jjtj|�fS)Nz%s(%s))r�__name__r�__repr__)rrrrr)gszMarkup.__repr__cCs|jtj|t|j|���S)N)rr�join�mapr)r�seqrrrr*mszMarkup.joincOstt|jtj|f|�|���S)N)�listr+rr�split)r�args�kwargsrrrr.qszMarkup.splitcOstt|jtj|f|�|���S)N)r-r+rr�rsplit)rr/r0rrrr1usz
Markup.rsplitcOstt|jtj|f|�|���S)N)r-r+rr�
splitlines)rr/r0rrrr2yszMarkup.splitlinescs(ddlm��fdd�}tj|t|��S)z�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>'
        r)�
HTML_ENTITIEScs�|jd�}|�krt�|�SyH|dd�dkrFtt|dd�d��S|jd�rdtt|dd���SWntk
rzYnXdS)	N���#x�#X��#r
)r6r7)�groupr�int�
startswith�
ValueError)�m�name)r3rr�handle_match�s

z%Markup.unescape.<locals>.handle_match)Zmarkupsafe._constantsr3�
_entity_re�subr)rr@r)r3r�unescape~szMarkup.unescapecCs"djtjd|�j��}t|�j�S)aUnescape 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'
        � r
)r*�
_striptags_rerBr.r	rC)r�strippedrrr�	striptags�szMarkup.striptagscCst|�}|j|k	r||�S|S)z�Escape the string.  Works like :func:`escape` with the difference
        that for subclasses of :class:`Markup` this function would return the
        correct subclass.
        )rr)r�s�rvrrrr�s
z
Markup.escapecs*tt|���fdd�}�j|_�j|_|S)Ncs>tt|�t|�|j�}t|t|�|j�|j�|f|�|��S)N)�_escape_argspecr-�	enumeraterrr)rr/r0)�origrr�func�sz1Markup.make_simple_escaping_wrapper.<locals>.func)�getattrrr(�__doc__)r?rMr)rLr�make_simple_escaping_wrapper�s

z#Markup.make_simple_escaping_wrapper�__getitem__�
capitalize�title�lower�upper�replace�ljust�rjust�lstrip�rstrip�center�strip�	translate�
expandtabs�swapcase�zfill�	partitioncCstt|jtj||j|����S)N)r%r+rrrar)r�seprrrra�szMarkup.partitioncCstt|jtj||j|����S)N)r%r+rr�
rpartitionr)rrbrrrrc�szMarkup.rpartition�formatcOs>|d|dd�}}t|j�}t||�}|j|j|||��S)Nrr4)�EscapeFormatterr�_MagicFormatMappingrZvformat)r/r0rZ	formatterrrrrd�s

z
Markup.formatcCs|rtd��|S)Nz,Unsupported format specification for Markup.)r=)r�format_specrrr�__html_format__�szMarkup.__html_format__�__getslice__)r
Nr)rQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`) r(�
__module__�__qualname__rO�	__slots__rrrrr �__rmul__r&r)r*rr.r1r2rCrG�classmethodrrP�method�localsrrarcrdrhri�
__classcell__rr)rrr	sH*





c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rfz�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)Nr)�_args�_kwargs�_last_index)rr/r0rrr�__init__�sz_MagicFormatMapping.__init__cCsN|dkrD|j}|jd7_y
|j|Stk
r:YnXt|�}|j|S)Nr
r4)rtrr�LookupError�strrs)r�key�idxrrrrQ�s
z_MagicFormatMapping.__getitem__cCs
t|j�S)N)�iterrs)rrrr�__iter__�sz_MagicFormatMapping.__iter__cCs
t|j�S)N)�lenrs)rrrr�__len__�sz_MagicFormatMapping.__len__N)r(rjrkrOrurQr{r}rrrrrf�s
rfrdc@seZdZdd�Zdd�ZdS)recCs
||_dS)N)r)rrrrrru�szEscapeFormatter.__init__cCsTt|d�r|j|�}n0t|d�r6|r,td��|j�}ntjj|||�}t|j|��S)NrhrzSNo format specification allowed when formatting an object with its __html__ method.)	rrhr=r�string�	Formatter�format_fieldrr)r�valuergrIrrrr��s


zEscapeFormatter.format_fieldN)r(rjrkrur�rrrrre�srecCs6x0|D](\}}t|d�s"t|t�r||�||<qW|S)z,Helper for various string-wrapped functions.r)rrr)�obj�iterablerrxr�rrrrJsrJc@sDeZdZdZdd�Zdd�Zdd�ZZdd�Zdd�Z	d	d�Z
d
S)r!zHelper for Markup.__mod__cCs||_||_dS)N)r�r)rr�rrrrrusz_MarkupEscapeHelper.__init__cCst|j||j�S)N)r!r�r)rHr#rrr�<lambda>sz_MarkupEscapeHelper.<lambda>cCst|j|j��S)N)rrr�)rHrrrr�scCst|jt|j���S)N)rwr�reprr�)rHrrrr�scCs
t|j�S)N)r;r�)rHrrrr�scCs
t|j�S)N)�floatr�)rHrrrr�sN)r(rjrkrOrurQZ__unicode__�__str__r)�__int__�	__float__rrrrr!sr!)rrr
�soft_str) rO�rer~�collectionsrZmarkupsafe._compatrrrrrr�__all__�compilerErAr	rfrrrerJ�objectr!Zmarkupsafe._speedupsrrr
�ImportErrorZmarkupsafe._nativer��appendrrrr�<module>
s* 

@


Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 11.05 KB 0644
__init__.cpython-36.pyc File 11.05 KB 0644
_compat.cpython-36.opt-1.pyc File 737 B 0644
_compat.cpython-36.pyc File 737 B 0644
_constants.cpython-36.opt-1.pyc File 4.2 KB 0644
_constants.cpython-36.pyc File 4.2 KB 0644
_native.cpython-36.opt-1.pyc File 1.34 KB 0644
_native.cpython-36.pyc File 1.34 KB 0644
tests.cpython-36.opt-1.pyc File 6.8 KB 0644
tests.cpython-36.pyc File 7.88 KB 0644