HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/docutils/parsers/rst/directives/__pycache__/__init__.cpython-36.pyc
3

v2�e�6�,@s�dZdZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZ
ejdtkrbdd	lmZdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d=�+ZiZd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�ZdHdI�ZdJdK�ZdLdM�ZdNdO�ZdPdQdRdSdTdUdVdWgZdXdY�ZdZd[�Zd�d]d^�Zd_d`�Z ej!daej"�Z#dbdc�Z$ddde�Z%dfdg�Z&dhdi�Z'djdk�Z(dldm�Z)dndo�Z*dpdq�Z+drds�Z,dS)�z9
This package contains directive implementation modules.
ZreStructuredText�N)�nodes)�split_escaped_whitespace�escape2null�unescape)�en��)�
__import__�admonitions�	Attention�Caution�body�	CodeBlock�Danger�Error�	Important�Note�Tip�Hint�Warning�
Admonition�Sidebar�Topic�	LineBlock�
ParsedLiteral�	MathBlock�Rubric�Epigraph�
Highlights�	PullQuote�Compound�	Container�tables�RSTTable�CSVTable�	ListTable�images�Image�Figure�parts�Contents�Sectnum�Header�Footer�
references�TargetNotes�html�Meta�misc�Raw�Include�Replace�Unicode�Class�Role�DefaultRole�Title�Date�
TestDirective)+Z	attentionZcaution�codeZdanger�errorZ	importantZnoteZtipZhintZwarningZ
admonitionZsidebarZtopicz
line-blockzparsed-literalZmathZrubricZepigraphZ
highlightsz
pull-quoteZcompoundZ	container�tablez	csv-tablez
list-tableZimageZfigure�contentsZsectnum�headerZfooterztarget-notes�meta�raw�include�replaceZunicode�classZrolezdefault-role�titleZdatezrestructuredtext-test-directivec8Cs�|j�}g}g}|tkr$t||fSd}y|j|}WnZtk
rj}z|jd||f�WYdd}~Xn(tk
r�|jd||jf�YnX|s�ytj|}|jd|�Wn&tk
r�|jd|�|}YnX|�r|jj	dj
|�|jd�}|j|�yt|\}	}
Wntk
�r,d|fSXyt
|	t�t�dd	�}WnHtk
�r�}z*|j|jjd
|	||f|jd��d|fSd}~XnXyt||
�}
|
t|<Wn<tk
�r�|j|jjd|
|	|f|jd��d|fSX|
|fS)z�
    Locate and return a directive function from its language-dependent name.
    If not found in the current language, check English.  Return None if the
    named directive cannot be found.
    Nz?Problem retrieving directive entry from language module %r: %s.z+No directive entry for "%s" in module "%s".z*Using English fallback for directive "%s".z(Trying "%s" as canonical directive name.�
)�line�)�levelz:Error importing directive module "%s" (directive "%s"):
%sz8No directive class "%s" in module "%s" (directive "%s").)�lower�_directivesZ
directives�AttributeError�append�KeyError�__name__�_fallback_language_moduleZreporter�info�joinZcurrent_line�_directive_registryr	�globals�locals�ImportErrorr>�getattr)Zdirective_nameZlanguage_moduleZdocumentZnormnameZmessagesZmsg_textZ
canonicalnamer>�messageZ
modulenameZ	classname�module�detail�	directive�r^�/usr/lib/python3.6/__init__.pyr]Msb









r]cCs|t|<dS)z�
    Register a nonstandard application-defined directive function.
    Language lookups are not needed for such functions.
    N)rM)�namer]r^r^r_�register_directive�sracCs"|r|j�rtd|��ndSdS)z�
    Check for a valid flag option (no argument) and return ``None``.
    (Directive option conversion function.)

    Raise ``ValueError`` if an argument is found.
    z%no argument is allowed; "%s" suppliedN)�strip�
ValueError)�argumentr^r^r_�flag�srecCs|dkrtd��n|SdS)z�
    Return the argument text, unchanged.
    (Directive option conversion function.)

    Raise ``ValueError`` if no argument is found.
    Nz#argument required but none supplied)rc)rdr^r^r_�unchanged_required�s
rfcCs|dkrdS|SdS)z�
    Return the argument text, unchanged.
    (Directive option conversion function.)

    No argument implies empty string ("").
    N�r^)rdr^r^r_�	unchanged�srhcCs2|dkrtd��ndjdd�|j�D��}|SdS)z�
    Return the path argument unwrapped (with newlines removed).
    (Directive option conversion function.)

    Raise ``ValueError`` if no argument is found.
    Nz#argument required but none suppliedrgcSsg|]}|j��qSr^)rb)�.0�sr^r^r_�
<listcomp>�szpath.<locals>.<listcomp>)rcrT�
splitlines)rd�pathr^r^r_rm�s
rmcCs:|dkrtd��n$tt|��}djdd�|D��}|SdS)z�
    Return the URI argument with unescaped whitespace removed.
    (Directive option conversion function.)

    Raise ``ValueError`` if no argument is found.
    Nz#argument required but none supplied� css |]}djt|�j��VqdS)rgN)rTr�split)ri�partr^r^r_�	<genexpr>�szuri.<locals>.<genexpr>)rcrrrT)rdr)�urir^r^r_rr�s

rrcCst|�}|dkrtd��|S)z|
    Check for a nonnegative integer argument; raise ``ValueError`` if not.
    (Directive option conversion function.)
    rz(negative value; must be positive or zero)�intrc)rd�valuer^r^r_�nonnegative_int�srucCs,y|jd�}Wntk
r"YnXt|�S)zK
    Check for an integer percentage value with optional percent sign.
    z %)�rstriprNru)rdr^r^r_�
percentage�s
rwZemZexZpx�in�cmZmmZptZpccCsrtjddj|�|�}yt|jd��Wn4ttfk
r\tddjdd�|D����YnX|jd�|jd�S)	z�
    Check for a positive argument of one of the units and return a
    normalized string of the form "<value><unit>" (without space in
    between).

    To be called from directive option conversion functions.
    z^([0-9.]+) *(%s)$�|rJz8not a positive measure of one of the following units:
%srncSsg|]}d|�qS)z"%s"r^)ri�ir^r^r_rk�szget_measure.<locals>.<listcomp>r)�re�matchrT�float�grouprNrc)rdZunitsr}r^r^r_�get_measure�sr�cCst|tdg�S)Nrg)r��length_units)rdr^r^r_�length_or_unitless�sr�rgcCs\yt|tdg�Stk
rVyt|dg�|Stk
rPt|tdg�SXYnXdS)a�
    Return normalized string of a length or percentage unit.

    Add <default> if there is no unit. Raise ValueError if the argument is not
    a positive measure of one of the valid CSS units (or without unit).

    >>> length_or_percentage_or_unitless('3 pt')
    '3pt'
    >>> length_or_percentage_or_unitless('3%', 'em')
    '3%'
    >>> length_or_percentage_or_unitless('3')
    '3'
    >>> length_or_percentage_or_unitless('3', 'px')
    '3px'
    �%rgN)r�r�rc)rd�defaultr^r^r_� length_or_percentage_or_unitless�sr�cCsR|dkrtd��|j�}g}x0|D](}tj|�}|s@td|��|j|�q"W|S)z�
    Convert the argument into a list of ID-compatible strings and return it.
    (Directive option conversion function.)

    Raise ``ValueError`` if no argument is found.
    Nz#argument required but none suppliedz"cannot make "%s" into a class name)rcrorZmake_idrO)rd�namesZclass_namesr`�
class_namer^r^r_�class_options

r�z2(?:0x|x|\\x|U\+?|\\u)([0-9a-f]+)$|&#x([0-9a-f]+);$cCs�yL|j�rtt|��Stj|�}|rF|jd�p6|jd�}tt|d��S|SWn.tk
rz}ztd|��WYdd}~XnXdS)a�
    Convert a Unicode character code to a Unicode character.
    (Directive option conversion function.)

    Codes may be decimal numbers, hexadecimal numbers (prefixed by ``0x``,
    ``x``, ``\x``, ``U+``, ``u``, or ``\u``; e.g. ``U+262E``), or XML-style
    numeric character entities (e.g. ``&#x262E;``).  Other text remains as-is.

    Raise ValueError for illegal Unicode code values.
    rJr�zcode too large (%s)N)�isdigit�chrrs�unicode_patternr}r�
OverflowErrorrc)r=r}rtr\r^r^r_�unicode_code%s
r�cCs$t|�}t|�dkr td|��|S)z�
    A single character is returned as-is.  Unicode characters codes are
    converted as in `unicode_code`.  (Directive option conversion function.)
    rJz8%r invalid; must be a single character or a Unicode code)r��lenrc)rd�charr^r^r_�single_char_or_unicode=s
r�cCs(|dkrd}n|dkrd}nt|�}|S)z�
    As with `single_char_or_unicode`, but "tab" and "space" are also supported.
    (Directive option conversion function.)
    Ztab�	Zspacern)r�)rdr�r^r^r_�$single_char_or_whitespace_or_unicodeHsr�cCst|�}|dkrtd��|S)z�
    Converts the argument into an integer.  Raises ValueError for negative,
    zero, or non-integer values.  (Directive option conversion function.)
    rJz(negative or zero value; must be positive)rsrc)rdrtr^r^r_�positive_intUsr�cCs*d|kr|jd�}n|j�}dd�|D�S)z�
    Converts a space- or comma-separated list of values into a Python list
    of integers.
    (Directive option conversion function.)

    Raises ValueError for non-positive-integer values.
    �,cSsg|]}t|��qSr^)r�)ri�entryr^r^r_rkksz%positive_int_list.<locals>.<listcomp>)ro)rdZentriesr^r^r_�positive_int_list_sr�cCs4ytj|�Wn tk
r.td|��YnX|S)z�
    Verfies the encoding argument by lookup.
    (Directive option conversion function.)

    Raises ValueError for unknown encodings.
    zunknown encoding: "%s")�codecs�lookup�LookupErrorrc)rdr^r^r_�encodingms
r�c
CsZy|j�j�}Wn$tk
r4tdt|���YnX||krB|Std|t|�f��dS)a
    Directive option utility function, supplied to enable options whose
    argument must be a member of a finite set of possible values (must be
    lower case).  A custom conversion function must be written to use it.  For
    example::

        from docutils.parsers.rst import directives

        def yesno(argument):
            return directives.choice(argument, ('yes', 'no'))

    Raise ``ValueError`` if no argument is found or if the argument's value is
    not valid (not an entry in the supplied list).
    z'must supply an argument; choose from %sz"%s" unknown; choose from %sN)rLrbrNrc�
format_values)rd�valuesrtr^r^r_�choicezsr�cCs(ddjdd�|dd�D��|dfS)Nz%s, or "%s"z, cSsg|]}d|�qS)z"%s"r^)rirjr^r^r_rk�sz!format_values.<locals>.<listcomp>rJ���r�)rT)r�r^r^r_r��sr�cs��fdd�}|S)zA
    The argument can be any of `values` or `argument_type`.
    cs|�kr|S�|�SdS)Nr^)rd)�otherr�r^r_�
auto_or_other�szvalue_or.<locals>.auto_or_otherr^)r�r�r�r^)r�r�r_�value_or�sr�)rr)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r)r
r )r
r!)r"r#)r"r$)r"r%)r&r')r&r()r)r*)r)r+)r)r,)r)r-)r.r/)r0r1)r2r3)r2r4)r2r5)r2r6)r2r7)r2r8)r2r9)r2r:)r2r;)r2r<)rg)-�__doc__Z
__docformat__r|r��sysZdocutilsrZdocutils.utilsrrrZdocutils.parsers.rst.languagesrrR�version_infoZdocutils._compatr	rUrMr]rarerfrhrmrrrurwr�r�r�r�r��compile�
IGNORECASEr�r�r�r�r�r�r�r�r�r�r^r^r^r_�<module>s�
: