
    N&iV                     ^    d Z dZddlZddlmZ ddlmZ  G d de          Z e            Z	dS )zL
This package contains modules for language-dependent features of Docutils.
reStructuredText    N)import_module)normalize_language_tagc                   :    e Zd ZdZdZdZdZd Zd
dZd Z	d
d	Z
dS )LanguageImportera  Import language modules.

    When called with a BCP 47 language tag, instances return a module
    with localisations from `docutils.languages` or the PYTHONPATH.

    If there is no matching module, warn (if a `reporter` is passed)
    and fall back to English.
    )zdocutils.languages. zHLanguage "%s" not supported: Docutils-generated text will be in English.enc                     i | _         d S N)cache)selfs    h/home/geonatureadmin/si_en_reseau/tutos/venv/lib/python3.11/site-packages/docutils/languages/__init__.py__init__zLanguageImporter.__init__#   s    


    Nc                    d}| j         D ]|}	 t          ||z             }|                     |           nQ# t          t          f$ r= |r|r|                    d|z             n|r|                    d||z   z             Y xw xY w |S )z/Try loading module `name` from `self.packages`.Nz+%s is no complete Docutils language module.zModule "%s" not found.)packagesr   check_contentImportErrorAttributeErrorinfo)r   namereportermodulepackages        r   import_from_packagesz%LanguageImporter.import_from_packages&   s    } 	 	G	&wt|44""6****0    K KMM"O#)#* + + + + KMM":GDL"IJJJ s   '5ABBc                     t          |j        t                    r4t          |j        t                    rt          |j        t
                    st          dS )z+Check if we got a Docutils language module.N)
isinstancelabelsdictbibliographic_fieldsauthor_separatorslistr   )r   r   s     r   r   zLanguageImporter.check_content7   sR    6=$// 	v:DAA	v7>>	 	 	r   c                    	 | j         |         S # t          $ r Y nw xY wt          |          D ]2}|                    dd          }|                     ||          }| nA3|r|                    | j        |z             | j        r|                     | j                  }|r"|dk    r|                    d|d|d           || j         |<   |S )N-_r	   zUsing z for language "z".)	r   KeyErrorr   replacer   warningwarn_msgfallbackr   )r   language_coder   tagr   s        r   __call__zLanguageImporter.__call__>   s   	:m,, 	 	 	D	)-88 		B 		BC++c3''C..sH==F! "  @  !>???} B224=AA 	Q$..MMMOPPP$*
=!s    
r   )__name__
__module____qualname____doc__r   r)   r*   r   r   r   r-    r   r   r   r      sw          +H>HH     "       r   r   )
r1   __docformat__sys	importlibr   docutils.utilsr   objectr   get_languager2   r   r   <module>r9      s     # 



 # # # # # # 1 1 1 1 1 1< < < < <v < < <~  !!r   