Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/docutils/__pycache__/core.cpython-311.pyc



]jdZdZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZm
Z
mZddlmZddlmZGddZd	Zd
Zdddddd
ddddddeefdZ							d$dZ							d%dZdejddddddd
dddddfdZdejdddddddddfdZ					d&dZdddddd
ddddddeedejfdZdZd'dZ dZ!dZ"dZ#dZ$dZ%dZ&d Z'd!Z(d"Z)d#Z*dS)(a
Calling the ``publish_*`` convenience functions (or instantiating a
`Publisher` object) with component names will result in default
behavior.  For custom behavior (setting component options), create
custom component objects first, and pass *them* to
``publish_*``/`Publisher`.  See `The Docutils Publisher`_.

.. _The Docutils Publisher:
    https://docutils.sourceforge.io/docs/api/publisher.html
reStructuredTextN)__version____version_details__SettingsSpecioutilsreaderswriters)OptionParser)doctreeceZdZdZddddejdejdfdZdZdZ	dZ
		ddZdZ		dd	Z
d
Z		ddZddZdd
ZddZdZ			ddZdZdZdZdZdZdS)	PublisherzK
    A facade encapsulating the high-level logic of a Docutils system.
    Nc		Zd|_	||_	||_	||_	dD]G}	t	t||	tr"Jdt||	d|	d|	dH||_	||_	||_		||_
	||_	tj
|_dS)a
        Initial setup.  If any of `reader`, `parser`, or `writer` are not
        specified, ``set_components()`` or the corresponding ``set_...()``
        method should be called with component names
        (`set_reader` sets the parser as well).
        N)readerparserwriterzpassed string "z" as "z+" parameter; pass an instance, or use the "zL_name" parameter instead (in docutils.core.publish_* convenience functions).)documentrrr
isinstancegetattrstrsourcesource_classdestinationdestination_classsettingsrErrorOutput_stderr)
selfrrrrrrrr	components
          m/builddir/build/BUILD/imunify360-venv-2.6.3/opt/imunify360/venv/lib/python3.11/site-packages/docutils/core.py__init__zPublisher.__init__$s
;3335	D	DI!'$	":":C@@
D
D
D4++++YYY			C
D
D@
DG(?&	"3D 
	J~''crtj|}||||_|jj|_dS)zSet `self.reader` by name.N)r	get_reader_classrr)rreader_namerparser_namereader_classs     r 
set_readerzPublisher.set_readerUs5/<<"l6;77k(r"cLtj|}||_dS)zSet `self.writer` by name.N)r
get_writer_classr)rwriter_namewriter_classs   r 
set_writerzPublisher.set_writer[s#/<<"lnnr"c|j|||j||j7|jj|j||jj|_|j||dSdSN)rr(r
set_parserrr-)rr%r&r+s    r set_componentszPublisher.set_components`s;OOKkBBB;{!)&&{333+,DK;OOK(((((r"c0tjdtd|rR|st}||_|}t
|dkr|ddkrdg|_t|j	|j
|j|f|d||	S)
NzRPublisher.setup_option_parser is deprecated, and will be removed in Docutils 0.21.)
stacklevelapplicationapplicationsT)
componentsdefaultsread_config_filesusagedescription)warningswarnDeprecationWarningrconfig_sectionsplitlenconfig_section_dependenciesrrrr)rr<r=
settings_specrAr:partss       r setup_option_parserzPublisher.setup_option_parserjs	
>(Q	8	8	8	8	M 
/ ,
+9M("((**E5zzA~~%)}"<"<=K<L
9T[$+}M[222	2r"ctj5tjdt|j|i|cdddS#1swxYwYdS)Nignore)category)r>catch_warningsfilterwarningsr@rG)rargskwargss   r _setup_settings_parserz Publisher._setup_settings_parser}s
$
&
&	=	=#H7IJJJJ+4+T<V<<	=	=	=	=	=	=	=	=	=	=	=	=	=	=	=	=	=	=s(A		A
A
cd|j||||fi|}||_|jS)a
        Return settings from components and config files.

        Please set components first (`self.set_reader` & `self.set_writer`).
        Use keyword arguments to override component defaults
        (before updating from configuration files).

        Calling this function also sets `self.settings` which makes
        `self.publish()` skip parsing command line options.
        )rOget_default_valuesr)rr<r=rErAr:
option_parsers       r get_settingszPublisher.get_settingssM43;
~KKAIKK
%88::
}r"c|j@|r|ni}|dd|jd||d|dSdS)N	tracebackT)rErA)rcopy
setdefaultrS)rrEsettings_overridesrAr:s     r process_programmatic_settingsz'Publisher.process_programmatic_settingss~= 4FN)..000BHT222D
*M-;
*
* (
*
*
*
*
*	! r"c|j||||fi|}|tjdd}|||_dS)z
        Parse command line arguments and set ``self.settings``.

        Pass an empty sequence to `argv` to avoid reading `sys.argv`
        (the default behaviour).

        Set components first (`self.set_reader` & `self.set_writer`).
        Nr5)rOsysargv
parse_argsr)rr]r<r=rErAr:rRs        r process_command_linezPublisher.process_command_lines_43;
~KKAIKK
<8ABB<D%0066


r"c~|j|||j||dSdS)N)source_path)destination_path)r
set_sourcerset_destination)rrarbs   r set_iozPublisher.set_iosM;OOO444#  2B CCCCC$#r"c|
|jj}n||j_||||jj|jj|_dS)N)rraencoding
error_handler)r_sourcerinput_encodinginput_encoding_error_handlerr)rrras   r rczPublisher.set_sourcesU-/KK$/DM!''{]1-D(FFr"cp|u|jjr5|jjr)|jj|jjkrtd|jjdkrd|j_|jjp|jj}||j_||||jj|jj|_dS)NziThe positional argument <destination> is obsoleted by the --output option.  You cannot use them together.-)rrbrgrh)routput_destination
SystemExitroutput_encodingoutput_encoding_error_handlerr)rrrbs   r rdzPublisher.set_destinations#
$
B)C
BM(DM,FFF "ABBB}#s**'+
$ $
 4!>#'=#=
%5
"11#-]2-E	2GGr"c|jj|j|j|jj|j|jf|jjdSr/)	rtransformerpopulate_from_componentsrrrrrapply_transformsrs r rvzPublisher.apply_transformss]
!::
[$+t{'94;


	 	 	 	

!2244444r"Fcrd}	|j|j|||||fi|pi|||j|j|j|j|_|	|j
|j|j}	|j

nt#t$r}
d}|
j}Yd}
~
n\d}
~
wt $rL}
|js|jjr|||
d}d}Yd}
~
nd}
~
wwxYw||rM|jrF|jjj|jjkr't/j|jjjdzn|rt/j||	S)z
        Process command line options and arguments (if `self.settings` not
        already set), run `self.reader` and then `self.writer`.  Return
        `self.writer`'s output.
        NTr5
)rr_repromptrreadrrrrvrwriterassemble_partsrpcode	ExceptionrUdebugging_dumpsreport_Exceptionreporter	max_levelexit_status_levelr\exit)rr]r<r=rErYrAenable_exit_statusrrnerrorexit_statuss            r publishzPublisher.publishs	}$))%m^22)/R222
KKMMMKKMMM K,,T[$+-1]<<DM!!###[&&t}d6FGGFK&&((((	%	%	%D*KKKKKK			=
}&
$$&&&!!%(((DKKKKKK		
	"4=	"'1M344HT]+5:;;;;
	"H[!!!
s%CC


D;	C""
D;/AD66D;c"|jsdS|jjrHtd|jttj|jj|j|jjrHtd|jttj|jj|j|jj	rmtd|jtd|jttjd|jj
jD|j|jjrXtd|jt|j
d|jdSdS)	Nz
::: Runtime settings:filez
::: Document internals:z
::: Transforms applied:z@ (priority, transform class, pending node details, keyword args)cPg|]#\}}}}||jd|j|o|j|f$S).)
__module____name__details).0priorityxclasspendingrNs     r 
<listcomp>z-Publisher.debugging_dumps.<locals>.<listcomp>sU7776Xvwv'8'8'8&//J-gov7777r"z
::: Pseudo-XML:raw_unicode_escape)rr
dump_settingsprintrpprintpformat__dict__dump_internalsdump_transformsrtapplieddump_pseudo_xmlencoderws r rzPublisher.debugging_dumpss}	F=&	M+$,????&.!788t|LLLL='	M-DLAAAA&.!788t|LLLL=(	L-DLAAAA"(,
6
6
6
6&.77M-577788?Cl	
L
L
L
L
=(	:%DL9999$-''))00$&&,0L
:
:
:
:
:
:	:	:r"c	|jr|jsdSn#t$rYdSwxYwtjdkrdnd}d}d}	|jjd}|jjd}n#ttf$rYnwxYwtdtd	|d
|d|d	|j
dS)z=Print info and prompt when waiting for input from a terminal.NntzCtrl+ZzCtrl+Dzuseful formatsrz	Docutils z/ <https://docutils.sourceforge.io>
converting "z" into "zT".
Call with option "--help" for more info.
.. Waiting for source text (finish with z on an empty line):r)risattyrAttributeErrorosnamer	supportedr
IndexErrorrr)reot_key	in_format
out_formats    r rzzPublisher.prompts-	K&&((
T\-@-@-B-B

			FF	 goo((8	%
	-a0I.q1JJ
+			D	
#+##&##0:##:A###
<	!	!	!	!	!	!s!27
AA!$BBBct|tjr||dSt|tr||dSt|tjr1|j	dt
j
|zdSt|tjr1|j	dt
j
|zdStdt
j
|z|jtdttrdtdndd	tjd
d|jdS)Nz-Unable to open source file for reading:
  %s
z2Unable to open destination file for writing:
  %s
z%srzExiting due to error.  Use "--traceback" to diagnose.
Please report errors to <docutils-users@lists.sourceforge.net>.
Include "--traceback" output, Docutils version (z []r),
Python version (rz5), your OS type & version, and the command line used.)rr
SystemMessagereport_SystemMessageUnicodeEncodeErrorreport_UnicodeErrorr
InputErrorrr|error_stringOutputErrorrrrr\versionrBrrs  r rzPublisher.report_Exception1seU011	2%%e,,,,,
1
2
2	2$$U+++++
r}
-
-	2L (*,/%*@*@ A
B
B
B
B
B
r~
.
.	2L?5112
3
3
3
3
3
$///dlCCCC2=!4;	
""$$Q'%)L

2
2
2
2
2
2r"c~td|jdtjj|jd|jdS)NzExiting due to level-z (z) system message.r)rlevelrReporterlevelsrrs  r rzPublisher.report_SystemMessageGsM
+++u~4U[AAAC<	!	!	!	!	!	!r"c|j|j|j}|jtj|d|jjd|	ddd|	ddd|jj
dtd	tj
d
ddS)Nz!

The specified output encoding (z) cannot
handle all of the output.
Try setting "--output-encoding-error-handler" to

* "xmlcharrefreplace" (for HTML & XML output);
  the output will contain "asciixmlcharrefreplacezU" and should be usable.
* "backslashreplace" (for other output formats);
  look for "backslashreplacezr" in the output.
* "replace"; look for "?" in the output.

"--output-encoding-error-handler" is currently set to "z".

Exiting due to error.  Use "--traceback" to diagnose.
If the advice above doesn't eliminate the error,
please report it to <docutils-users@lists.sourceforge.net>.
Include "--traceback" output, Docutils version (rrz6), your OS type & version, and the
command line used.
)objectstartendrr|rrrrqrrrrr\rrB)rrdatas   r rzPublisher.report_UnicodeErrorLs|EK	12*u%%%%},,,{{7$78888{{7$67777}:::{{CK--//2223
4	5	5	5	5	5r")NNNN)NNNNN)NN)NNNNNNF)rr__qualname____doc__r	FileInput
FileOutputr!r(r-r1rGrOrSrZr_rercrdrvrrrzrrrrVr"r rrs#42<!R]/(/(/(/(b)))%%%
)));??C2222&===488<"	*	*	*GK@D7777"DDDDFFFFGGGG$555:>7;8=((((T:::.!!!,222,!!!
55555r"rz*%prog [options] [<source> [<destination>]]zReads from <source> (default is stdin) and writes to <destination> (default is stdout).  See https://docutils.sourceforge.io/docs/user/config.html for a detailed settings reference.
standalonerestructuredtext	pseudoxmlTc	t||||}||||||||
|||	|
}|S)aT
    Set up & run a `Publisher` for command-line-based file I/O (input and
    output file paths taken automatically from the command line).
    Also return the output as `str` or `bytes` (for binary output document
    formats).

    Parameters: see `publish_programmatically()` for the remainder.

    - `argv`: Command-line argument list to use instead of ``sys.argv[1:]``.
    - `usage`: Usage string, output if there's a problem parsing the command
      line.
    - `description`: Program description, output for the "--help" option
      (along with command-line option descriptions).
    )rrArrr1r)rr%rr&rr+rrErYrArr]r<r=	publisherrns                r publish_cmdliner{sg*&&&8DDDI
[+{CCC


e[-1C%:LNNFMr"Fctdidtjd|d|dtjd|d|d|d|d	|d
|d|d|	d
|
d|d|d|
d|\}}|S)z
    Set up & run a `Publisher` for programmatic use with file-like I/O.
    Also return the output as `str` or `bytes` (for binary output document
    formats).

    Parameters: see `publish_programmatically()`.
    rrrarrrbrr%rr&rr+rrErYrArrV)publish_programmaticallyrrr)rrarrbrr%rr&rr+rrErYrArrnrs                 r publish_filers1
/
/
/\\
/*0&
/>Ik
/--
/ K
/3C2B
/v	
/$/;	
/
v
/
$/;
/v
/$/;
/
/*7
/.-
/&~
/.-
/FIMr"ctdidtjd|d|dtjddd|d|d	|d
|d|d|d
|d|	d|
d|d|d|
\}}|S)uC
    Set up & run a `Publisher` for programmatic use with string I/O.

    Accepts a `bytes` or `str` instance as `source`.

    The output is encoded according to the `output_encoding`_ setting;
    the return value is a `bytes` instance (unless `output_encoding`_ is
    "unicode", cf. `docutils.io.StringOutput.write()`).

    Parameters: see `publish_programmatically()`.

    This function is provisional because in Python 3 name and behaviour
    no longer match.

    .. _output_encoding:
        https://docutils.sourceforge.io/docs/user/config.html#output-encoding
    rrrarrNrbrr%rr&rr+rrErYrArrV)rrStringInputStringOutput)rrarbrr%rr&rr+rrErYrArrnrs                r publish_stringrs01
/
/
/^^
/,2F
/@K
///
/D
/,<+;
/v	
/$/;	
/
v
/
$/;
/v
/$/;
/
/*7
/.-
/&~
/.-
/FIMr"ctdid|d|d|dtjddd|d|d	|d
|d|d|d
|	d|
d|d|d|
d|\}}|jjS)a
    Set up & run a `Publisher`, and return a dictionary of document parts.

    Dictionary keys are the names of parts.
    Dictionary values are `str` instances; encoding is up to the client,
    e.g.::

       parts = publish_parts(...)
       body = parts['body'].encode(parts['encoding'], parts['errors'])

    See the `API documentation`__ for details on the provided parts.

    Parameters: see `publish_programmatically()`.

    __ https://docutils.sourceforge.io/docs/api/publisher.html#publish-parts
    rrarrrNrbrr%rr&rr+rrErYrArrV)rrrrrF)rrarrbrr%rr&rr+rrErYrArrnrs                 r 
publish_partsrs01
/
/
/v
/#.;
/=I\
///
/D
/,<+;
/v	
/$/;	
/
v
/
$/;
/v
/$/;
/
/*7
/.-
/&~
/.-
/FI!!r"ctdid|d|d|dddddtjd|d	|d
|d|ddd
dd|d|d|	d|
d|\}}
|
jS)z
    Set up & run a `Publisher` for programmatic use. Return a document tree.

    Parameters: see `publish_programmatically()`.
    rrarrNrbrrr%rr&rr+nullrrErYrArrV)rr
NullOutputr)rrarrr%rr&rrErYrAr_outputrs              r publish_doctreers2
/
/
/v
/#.;
/!\
/D
/,04
/--	
/
v
/
$/;
/v
/$/;
/t
/"(
/
/*7
/.-
/?Mn
/.-
/GYr"c	Ftjd}	t|	d|tj|tj|}
|s|r|
||
||||
d||
	|S)u
    Set up & run a `Publisher` to render from an existing document tree
    data structure. For programmatic use with string output
    (`bytes` or `str`, cf. `publish_string()`).

    Note that ``document.settings`` is overridden; if you want to use the
    settings of the original `document`, pass ``settings=document.settings``.

    Also, new `document.transformer` and `document.reporter` objects are
    generated.

    Parameters: `document` is a `docutils.nodes.document` object, an existing
    document tree.

    Other parameters: see `publish_programmatically()`.

    This function is provisional because in Python 3 name and behaviour
    of the `io.StringOutput` class no longer match.
    r)r&N)rrrr)
rReaderrrDocTreeInputrr-rZrdr)rrbrr+rrErYrArrrs           r publish_from_doctreers0^
/
/
/F&$!#!:!:,.O#+---I*k*[)))
++)>;;;
d$45550BCCCr"c	t|||||}||||||||
|||	|
}|S)a
    Set up & run a `Publisher` for command-line-based file I/O (input and
    output file paths taken automatically from the command line).
    Also return the output as `bytes`.

    This is just like publish_cmdline, except that it uses
    io.BinaryFileOutput instead of io.FileOutput.

    Parameters: see `publish_programmatically()` for the remainder.

    - `argv`: Command-line argument list to use instead of ``sys.argv[1:]``.
    - `usage`: Usage string, output if there's a problem parsing the command
      line.
    - `description`: Program description, output for the "--help" option
      (along with command-line option descriptions).
    )rrrr)rr%rr&rr+rrErYrArr]r<r=rrrrns                  r publish_cmdline_to_binaryr?sp:&&&8,=???I
[+{CCC


e[-1C%:LNNFMr"ct|||
|||}|||	|||
||||||||||}||fS)a^
    Set up & run a `Publisher` for custom programmatic use.

    Return the output (as `str` or `bytes`, depending on `destination_class`,
    writer, and the "output_encoding" setting) and the Publisher object.

    Applications should not need to call this function directly.  If it does
    seem to be necessary to call this function directly, please write to the
    Docutils-develop mailing list
    <https://docutils.sourceforge.io/docs/user/mailing-lists.html#docutils-develop>.

    Parameters:

    * `source_class` **required**: The class for dynamically created source
      objects.  Typically `io.FileInput` or `io.StringInput`.

    * `source`: Type depends on `source_class`:

      - If `source_class` is `io.FileInput`: Either a file-like object
        (must have 'read' and 'close' methods), or ``None``
        (`source_path` is opened).  If neither `source` nor
        `source_path` are supplied, `sys.stdin` is used.

      - If `source_class` is `io.StringInput` **required**:
        The input as either a `bytes` object (ensure the 'input_encoding'
        setting matches its encoding) or a `str` object.

    * `source_path`: Type depends on `source_class`:

      - `io.FileInput`: Path to the input file, opened if no `source`
        supplied.

      - `io.StringInput`: Optional.  Path to the file or name of the
        object that produced `source`.  Only used for diagnostic output.

    * `destination_class` **required**: The class for dynamically created
      destination objects.  Typically `io.FileOutput` or `io.StringOutput`.

    * `destination`: Type depends on `destination_class`:

      - `io.FileOutput`: Either a file-like object (must have 'write' and
        'close' methods), or ``None`` (`destination_path` is opened).  If
        neither `destination` nor `destination_path` are supplied,
        `sys.stdout` is used.

      - `io.StringOutput`: Not used; pass ``None``.

    * `destination_path`: Type depends on `destination_class`:

      - `io.FileOutput`: Path to the output file.  Opened if no `destination`
        supplied.

      - `io.StringOutput`: Path to the file or object which will receive the
        output; optional.  Used for determining relative paths (stylesheets,
        source links, etc.).

    * `reader`: A `docutils.readers.Reader` object.

    * `reader_name`: Name or alias of the Reader class to be instantiated if
      no `reader` supplied.

    * `parser`: A `docutils.parsers.Parser` object.

    * `parser_name`: Name or alias of the Parser class to be instantiated if
      no `parser` supplied.

    * `writer`: A `docutils.writers.Writer` object.

    * `writer_name`: Name or alias of the Writer class to be instantiated if
      no `writer` supplied.

    * `settings`: A runtime settings (`docutils.frontend.Values`) object, for
      dotted-attribute access to runtime settings.  It's the end result of the
      `SettingsSpec`, config file, and option processing.  If `settings` is
      passed, it's assumed to be complete and no further setting/config/option
      processing is done.

    * `settings_spec`: A `docutils.SettingsSpec` subclass or object.  Provides
      extra application-specific settings definitions independently of
      components.  In other words, the application becomes a component, and
      its settings data is processed along with that of the other components.
      Used only if no `settings` specified.

    * `settings_overrides`: A dictionary containing application-specific
      settings defaults that override the defaults of other components.
      Used only if no `settings` specified.

    * `config_section`: A string, the name of the configuration file section
      for this application.  Overrides the ``config_section`` attribute
      defined by `settings_spec`.  Used only if no `settings` specified.

    * `enable_exit_status`: Boolean; enable exit status at end of processing?
    )rrrr)rr1rZrcrdr)rrrarrrbrr%rr&rr+rrErYrArrrns                   r rresJ&&&8'3,=???I[+{CCC
++)>;;;
---
k+;<<<


2D

E
EF9r"rcd|d|dtz}tjtjdt	||dS)Nz	Generate zZ documents from standalone reStructuredText sources <https://docutils.sourceforge.io/docs/z>.  r)r+r=)default_descriptionlocale	setlocaleLC_ALLr)rdocumenttypedoc_pathr=s    r 
rst2somethingrsj	@L	@	@19	@	@	@	
V]B'''K@@@@@@r"c(tddddS)NhtmlHTMLzuser/html.html#htmlrrVr"r rst2htmlrs&&"788888r"c(tddddS)Nhtml4z	XHTML 1.1zuser/html.html#html4css1rrVr"r 	rst2html4rs';(BCCCCCr"c(tddddS)Nhtml5HTML5zuser/html.html#html5-polyglotrrVr"r 	rst2html5rs'7$CDDDDDr"c(tddddS)NlatexLaTeXuser/latex.htmlrrVr"r 	rst2latexrs'7$566666r"c(tddddS)NmanpagezUnix manual (troff)zuser/manpage.htmlrrVr"r rst2manrs)24GHHHHHr"c(tddddS)NodtzOpenDocument text (ODT)z
user/odt.htmlrrVr"r rst2odtrs%2ODDDDDr"c(tddddS)Nrzpseudo-XML (test)ref/doctree.htmlrrVr"r 
rst2pseudoxmlr	s+24FGGGGGr"c(tddddS)Ns5zS5 HTML slideshowzuser/slide-shows.htmlrrVr"r rst2s5rs$+-DEEEEEr"c(tddddS)NxetexzLaTeX (XeLaTeX/LuaLaTeX)rrrVr"r 	rst2xetexrs'57HIIIIIr"c(tddddS)NxmlzDocutils-native XMLrrrVr"r rst2xmlrs%.0BCCCCCr")NNNNNrNrNrNNNNF)
NNNrNrNrNNNNF)NNrNNNNF)r)+r
__docformat__rrrr\r>docutilsrrrrrr	r
docutils.frontendrdocutils.readersrr
default_usagerrrrrrrrBinaryFileOutputrrrrrrrrrr	rrrrVr"r <module>rsa
		#








				



333333333333333333******$$$$$$J5J5J5J5J5J5J5J5Z
=
) \-?[!'+D'+$'5H
:+/48*6*<*5GK9>
8?C,8,>,704;?&+
####L'+#'<+=;t%)$%*#"#"#"#"L)-!#\-?!'+D',
4592=6:AE,1	"D"D"D"DJ&*|%)7I%){'+,015-115#'$1*=*.020C####LnnnhAAAA999DDDEEE777IIIEEEHHHFFFJJJDDDDDr"
Back to Directory File Manager