
    -Ph                     |    d Z dZddlmZ ddlmZmZmZ ddlm	Z	  G d de          Z
 G d d	e
          Zi Zd
 ZdS )z0
This package contains Docutils Reader modules.
reStructuredText    )import_module)utilsparsers	Component)	universalc                   J     e Zd ZdZdZdZ fdZddZd Zd Z	d	 Z
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.
    readerreadersc                     t                                                      t          j        t          j        t          j        gz   S N)superget_transformsr   DecorationsExposeInternalsStripComments)self	__class__s    Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/docutils/readers/__init__.pyr   zReader.get_transforms    s9    ww%%''9+@+4+D+4+B+D D 	D    Nc                 f    || _         	 ||r|                     |           d| _        	 d| _        dS )z
        Initialize the Reader instance.

        Several instance attributes are defined with dummy initial values.
        Subclasses may use these attributes as they wish.
        N)parser
set_parsersourceinput)r   r   parser_names      r   __init__zReader.__init__%   sI     	E >k>OOK(((<
	$ 	$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_parser;   s#    /<<"lnnr   c                     || _         | j        s|| _        || _        | j                                         | _        |                                  | j        S r   )r   r   settingsreadr   parsedocument)r   r   r   r#   s       r   r$   zReader.read@   sK    { 	! DK [%%''


}r   c                     |                                  x| _        }| j                            | j        |           dx|_        |_        dS )z(Parse `self.input` into a document tree.N)new_documentr&   r   r%   r   current_sourcecurrent_line)r   r&   s     r   r%   zReader.parseI   sJ    #'#4#4#6#66$*h///:>>("7"7"7r   c                 J    t          j        | j        j        | j                  S )z8Create and return a new empty document tree (root node).)r   r(   r   source_pathr#   r   s    r   r(   zReader.new_documentO   s    !$+"94=IIIr   )NN)__name__
__module____qualname____doc__component_typeconfig_sectionr   r   r   r$   r%   r(   __classcell__)r   s   @r   r
   r
      s          NND D D D D
$ $ $ $,% % %
  ? ? ?J J J J J J Jr   r
   c                       e Zd ZdZd ZdS )ReReaderz
    A reader which rereads an existing document tree (e.g. a
    deserializer).

    Often used in conjunction with `writers.UnfilteredWriter`.
    c                 *    t          j        |           S r   )r   r   r-   s    r   r   zReReader.get_transforms]   s     '---r   N)r.   r/   r0   r1   r    r   r   r6   r6   T   s-         . . . . .r   r6   c                 &   |                                  }t                              ||          }	 t          d|z             }nH# t          $ r; 	 t          |          }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_reader_aliasesgetr   ImportErrorr
   )reader_namenamemoduleerrs       r   get_reader_classrB   f   s    DtT**DJ24788 J J J	J"4((FF 	J 	J 	JHHH3HHIII	J FJ
 =s5   A 
B	AB	
B)A>>BB	B	N)r1   __docformat__	importlibr   docutilsr   r   r   docutils.transformsr   r
   r6   r;   rB   r8   r   r   <module>rG      s   
  # # # # # # # . . . . . . . . . . ) ) ) ) ) )@J @J @J @J @JY @J @J @JF. . . . .v . . .     r   