
    <i                        d Z ddlmZ dZddlZddlZddlmZmZm	Z	 ddl
mZ dZerddlmZ dd	lmZ dd
lmZ ddlmZ ddl
mZ  G d de	          Z G d de          ZddZdS )z0
This package contains Docutils Reader modules.
    )annotationsreStructuredTextN)utilsparsers	Component)	universalF)Final)nodes)Input)Parser)	Transformc                  n     e Zd ZU dZdZded<   dZded<   d fd	Z	 	 dddZddZ	d Z
ddZddZ xZS )Readera9  
    Abstract base class for docutils Readers.

    Each reader module or package must export a subclass also called 'Reader'.

    The two steps of a Reader's responsibility are to read data from the
    source Input object and parse the data with the Parser object.
    Call `read()` to process a document.
    readerr	   component_typereadersconfig_sectionreturnlist[type[Transform]]c                    t                                                      t          j        t          j        t          j        gz   S N)superget_transformsr   DecorationsExposeInternalsStripComments)self	__class__s    /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/docutils/readers/__init__.pyr   zReader.get_transforms,   s9    ww%%''9+@+4+D+4+B+D D 	D    NparserParser | str | Noneparser_name
str | NoneNonec                    || _         	 t          |t                    r|                     |           |8t	          j        dt          d           | j         |                     |           d| _        	 d| _        dS )a2  
        Initialize the Reader instance.

        :parser: A parser instance or name (an instance will be created).
        :parser_name: deprecated, use "parser".

        Several instance attributes are defined with dummy initial values.
        Subclasses may use these attributes as they wish.
        NzgArgument "parser_name" will be removed in Docutils 2.0.
  Specify parser name in the "parser" argument.   )
stacklevel)	r!   
isinstancestr
set_parserwarningswarnPendingDeprecationWarningsourceinput)r   r!   r#   s      r   __init__zReader.__init__1   s     &,	E fc"" 	$OOF###"M L 4C C C C {",,,$(<!%
	$ 	$r    r*   c                L    t          j        |          } |            | _        dS )zSet `self.parser` by name.N)r   get_parser_classr!   )r   r#   parser_classs      r   r+   zReader.set_parserT   s#    /<<"lnnr    c                    || _         | j        s|| _        || _        | j                                         | _        |                                  | j        S r   )r/   r!   settingsreadr0   parsedocument)r   r/   r!   r6   s       r   r7   zReader.readY   sK    { 	! DK [%%''


}r    c                    |                                  }| j                            | j        |           dx|_        |_        || _        dS )z(Parse `self.input` into a document tree.N)new_documentr!   r8   r0   current_sourcecurrent_liner9   )r   r9   s     r   r8   zReader.parseb   sH    $$&&$*h///:>>("7(0r    nodes.documentc                J    t          j        | j        j        | j                  S )z8Create and return a new empty document tree (root node).)r   r;   r/   source_pathr6   r   s    r   r;   zReader.new_documenti   s    !$+"94=IIIr    r   r   )NN)r!   r"   r#   r$   r   r%   )r#   r*   r   r%   )r   r%   )r   r>   )__name__
__module____qualname____doc__r   __annotations__r   r   r1   r+   r7   r8   r;   __classcell__)r   s   @r   r   r      s           %N$$$$%N%%%%D D D D D D 04+/!$ !$ !$ !$ !$F% % % %
  1 1 1 1J J J J J J J Jr    r   c                      e Zd ZdZddZdS )ReReaderz
    A reader which rereads an existing document tree (e.g. a
    deserializer).

    Often used in conjunction with `writers.UnfilteredWriter`.
    r   r   c                *    t          j        |           S r   )r   r   rA   s    r   r   zReReader.get_transformsw   s     '---r    NrB   )rC   rD   rE   rF   r    r    r   rJ   rJ   n   s2         . . . . . .r    rJ   reader_namer*   r   type[Reader]c                   |                                  }	 t          j        d|z             }nL# t          $ r? 	 t          j        |          }n&# t          $ r}t          d|  d          |d}~ww xY wY nw xY w|j        S )z6Return the Reader class from the `reader_name` module.zdocutils.readers.zReader "z" not found.N)lower	importlibimport_moduleImportErrorr   )rM   namemoduleerrs       r   get_reader_classrW   }   s    DM()<T)ABB M M M	M,T22FF 	M 	M 	MBBBBCCL	M FM
 =s2   . 
A7AA7
A1A,,A11A76A7)rM   r*   r   rN   )rF   
__future__r   __docformat__rQ   r,   docutilsr   r   r   docutils.transformsr   TYPE_CHECKINGtypingr	   r
   docutils.ior   docutils.parsersr   r   r   rJ   rW   rL   r    r   <module>r`      sW  
  # " " " " ""      . . . . . . . . . . ) ) ) ) ) ) .!!!!!!''''''------NJ NJ NJ NJ NJY NJ NJ NJb. . . . .v . . .
 
 
 
 
 
r    