
    ihN                     F    d dl Z d dlmZ d dlmZ d dlmZ  G d de      Zy)    N)Path)Union)
TextLoaderc                   2     e Zd ZdZdeeef   f fdZ xZS )PythonLoaderzFLoad `Python` files, respecting any non-default encoding if specified.	file_pathc                     t        |d      5 }t        j                  |j                        \  }}ddd       t        |   |       y# 1 sw Y   xY w)ziInitialize with a file path.

        Args:
            file_path: The path to the file to load.
        rbN)r   encoding)opentokenizedetect_encodingreadlinesuper__init__)selfr   fr   _	__class__s        i/var/www/html/dev/engine/venv/lib/python3.12/site-packages/langchain_community/document_loaders/python.pyr   zPythonLoader.__init__   sP     )T" 	?a"221::>KHa	?9x@	? 	?s   #AA)	__name__
__module____qualname____doc__r   strr   r   __classcell__)r   s   @r   r   r      s#    PA%T	"2 A A    r   )r   pathlibr   typingr   )langchain_community.document_loaders.textr   r    r   r   <module>r"      s       @A: Ar   