if>dZdZddlmZddlmZddlmZddl m Z m Z dZ iZ iZ dZd Zd Zd Zd ZGd dZGddZ d3dZdejie_edejedejedejedejedejedejedejedej  d3dZ!ede! d3dZ"ede"d3dZ#d ej$ie#_ed!e# d3d"Z%d#ej$ie%_ed$e% d3d%Z&ed&e& d3d'Z'ed(e'ed)e'ed*e'ed+e'ed,e'ed-e'ed.e'ed/e'ed0e'd1Z(d2Z)dS)4a This module defines standard interpreted text role functions, a registry for interpreted text roles, and an API for adding to and retrieving from the registry. See also `Creating reStructuredText Interpreted Text Roles`__. __ https://docutils.sourceforge.io/docs/ref/rst/roles.html The interface for interpreted role functions is as follows:: def role_fn(name, rawtext, text, lineno, inliner, options=None, content=None): code... # Set function attributes for customization: role_fn.options = ... role_fn.content = ... Parameters: - ``name`` is the local name of the interpreted text role, the role name actually used in the document. - ``rawtext`` is a string containing the entire interpreted text construct. Return it as a ``problematic`` node linked to a system message if there is a problem. - ``text`` is the interpreted text content, with backslash escapes converted to nulls (````). - ``lineno`` is the line number where the text block containing the interpreted text begins. - ``inliner`` is the Inliner object that called the role function. It defines the following useful attributes: ``reporter``, ``problematic``, ``memo``, ``parent``, ``document``. - ``options``: A dictionary of directive options for customization, to be interpreted by the role function. Used for additional attributes for the generated elements and other functionality. - ``content``: A list of strings, the directive content for customization ("role" directive). To be interpreted by the role function. Function attributes for customization, interpreted by the "role" directive: - ``options``: A dictionary, mapping known option names to conversion functions such as `int` or `float`. ``None`` or an empty dict implies no options to parse. Several directive option conversion functions are defined in the `directives` module. All role functions implicitly support the "class" option, unless disabled with an explicit ``{'class': None}``. - ``content``: A boolean; true if content is allowed. Client code must handle the case where content is required but not supplied (an empty content list will be supplied). Note that unlike directives, the "arguments" function attribute is not supported for role customization. Directive arguments are handled by the "role" directive itself. Interpreted role functions return a tuple of two values: - A list of nodes which will be inserted into the document tree at the point where the interpreted role was encountered (can be an empty list). - A list of system messages, which will be inserted into the document tree immediately after the end of the current inline block (can also be empty). reStructuredText)nodes) directives)en)Lexer LexerErrorztitle-referencec|}g}g}|tvrt||fS|rpd} |j|}nf#t$r&}|d|d|dYd}~n;d}~wt $r$|d|d|jdYn wxYwt}|sV tj|}|d|zn*#t $r|d |z|}YnwxYw|r?| d || } || |tvr!t|} t|| | |fSd|fS) a1 Locate and return a role function from its language-dependent name, along with a list of system messages. If the role is not found in the current language, check English. Return a 2-tuple: role function (``None`` if the named role cannot be found) and a list of system messages. Nz3Problem retrieving role entry from language module z: .zNo role entry for "z " in module "z".z%Using English fallback for role "%s".z#Trying "%s" as canonical role name. line) lower_rolesrolesAttributeErrorappendKeyError__name__DEFAULT_INTERPRETED_ROLE_fallback_language_moduleinfojoin_role_registryregister_local_role) role_namelanguage_modulelinenoreporternormnamemessagesmsg_text canonicalnameerrormessagerole_fns z/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/docutils/parsers/rst/roles.pyroler'fs&  HHH6h)) 1  E+1(;MM I I I OOO0?H I I I I I I I I E E E OOO(yy/*B*B*BD E E E E E E1   % %5;HEM OOC'( ) ) ) ) % % % OOA'( ) ) )%MMM  %!-- ( 3 3&-AA   && /Hg...  >s/ A B A//.B B -*C$C?>C?c\t||t|<dS)z Register an interpreted text role by its canonical name. :Parameters: - `name`: The canonical name of the interpreted role. - `role_fn`: The role function. See the module docstring. N)set_implicit_optionsrrnamer%s r&register_canonical_roler,s*!!!#*N4::<<   c\t||t|<dS)z Register an interpreted text role by its local or language-dependent name. :Parameters: - `name`: The local or language-dependent name of the interpreted role. - `role_fn`: The role function. See the module docstring. N)r)rrr*s r&rrs*!!!"F4::<<r-ct|dr|jdtji|_dSd|jvrtj|jd<dSdS)z] Add customization options to role functions, unless explicitly set or disabled. optionsNclass)hasattrr0r class_option)r%s r&r)r)sZ 7I & &;'/*A"J$;<  ' '#-#:    ( 'r-cFt||}t||dS)zAFor roles which simply wrap a given `node_class` around the text.N) GenericRoler,)canonical_name node_classr's r&register_generic_roler8s' ~z 2 2DND11111r-c"eZdZdZdZ ddZdS)r5zr Generic interpreted text role. The interpreted text is simply wrapped with the provided node class. c"||_||_dSN)r+r7)selfrr7s r&__init__zGenericRole.__init__s $r-NcDt|}|j||fi|ggfSr;)normalized_role_optionsr7)r<r'rawtexttextrinlinerr0contents r&__call__zGenericRole.__call__s3)'229999:B>>r-NNr __module__ __qualname____doc__r=rDr-r&r5r5sF %%% (,??????r-r5c$eZdZdZddZ ddZdS) CustomRolez*Wrapper for custom interpreted text roles.Nc||_||_t|dd|_t|dd|_||_||_dS)Nr0rC)r+ base_rolegetattrr0rCsupplied_optionssupplied_content)r<rrNr0rCs r&r=zCustomRole.__init__sL "y)T:: y)T:: ' 'r-c t|j} ||n#t$rYnwxYw|jpg} |pg}| r|rdgng} |||||||| | z|zS)Nr )r0rC)r?rPupdate TypeErrorrQrN) r<r'r@rArrBr0rCoptsrQ delimiters r&rDzCustomRole.__call__s&t'<==  KK     D  06B-R.B7BTFF ~~dGT67&*&6y&@&HJJ Js , 99rErFrJr-r&rLrLsM44(((((, J J J J J Jr-rLNcLt|}tj||fi|ggfS)z9Base for custom roles if no other base role is specified.)r?rinline)r'r@rArrBr0rCs r&generic_custom_rolerYs3 &g..G L$ 2 2' 2 2 3R 77r-r1 abbreviationacronymemphasisliteralstrong subscript superscriptct|} ttj|}|dks|dkrtnL#t$r?|jd|z|}||||} | g|gfcYSwxYw|jj j |jj j |zz} tj |d|zfd| i|ggfS)Nri'z$ % %D :gt / /w / /D 62:r-rcz|jd|z|}||||}|g|gfS)Nz+Interpreted text role "%s" not implemented.r )rr#rf) r'r@rArrBr0rCrmrns r&unimplemented_rolersP   5<6 ! K KC   gw 4 4C 53%<r-indexznamed-referencezanonymous-referencez uri-referencezfootnote-referencezcitation-referencezsubstitution-referencetargetz#restructuredtext-unimplemented-rolecB|rd|vrd|vsJ|d|d<|d=dSdSdS)z7Deprecated. Obsoleted by ``normalized_role_options()``.r1rNrJ)r0s r& set_classesrsT 7g%%''''$W-  G   %%r-cf|iS|}d|vrd|vsJ|d|d<|d=|S)z Return normalized dictionary of role options. * ``None`` is replaced by an empty dictionary. * The key 'class' is renamed to 'classes'. Nr1r)copy)r0results r&r?r?sQ \\^^F&&&&&"7Oy 7O Mr-rE)*rI __docformat__docutilsrdocutils.parsers.rstrdocutils.parsers.rst.languagesrrdocutils.utils.code_analyzerrrrrrr'r,rr)r8r5rLrYr3r0rZr[r\r]r^r_r`title_referencerpr{r unchangedrrrrr?rJr-r&rs FFP# ++++++JJJJJJ::::::::,  333l + + + # # #;;;222 ????????"JJJJJJJJ8/38888 ' (?@ne&8999i///j%.111i///h ---k5?333mU%6777')>???.2PPPP&);<<<.22);<<<&j23x(((%)< !56  ***%) ***.2!3444)+=>>>-/ABBB);<<<,.@AAA,.@AAA02DEEE"4555=*,,,   r-