OwlCyberSecurity - MANAGER
Edit File: _functional.cpython-312.pyc
� C��g� � � � d Z ddlZddlmZmZ ddlmZ e� Zd� Z edd�d �Z d � Zedd�d�Zd� Z d � Zd� Zd� Zd� Zy)z5Simplified function-based API for importlib.resources� N� )�as_file�files)�TraversalErrorc �8 � t | |� j d� S )z8Open for binary reading the *resource* within *package*.�rb)� _get_resource�open��anchor� path_namess �N/opt/hc_python/lib/python3.12/site-packages/importlib_resources/_functional.py�open_binaryr s � ����,�1�1�$�7�7� �strict��encoding�errorsc �Z � t ||� }t | |� }|j d||�� S )z6Open for text reading the *resource* within *package*.�rr )�_get_encoding_argr r �r r r r �resources r � open_textr s/ � � ��X�6�H��V�Z�0�H��=�=��x��=�?�?r c �6 � t | |� j � S )zARead and return contents of *resource* within *package* as bytes.)r � read_bytesr s r �read_binaryr s � ����,�7�7�9�9r c �X � t ||� }t | |� }|j ||�� S )z?Read and return contents of *resource* within *package* as str.r )r r � read_textr s r r r s0 � � ��X�6�H��V�Z�0�H����x���?�?r c �, � t t | |� � S )z@Return the path to the *resource* as an actual file system path.)r r r s r �pathr! # s � ��=���4�5�5r c �V � t | |� j � S # t $ r Y yw xY w)zjReturn ``True`` if there is a resource named *name* in the package, Otherwise returns ``False``. F)r �is_filer r s r �is_resourcer$ ( s/ � � ��V�Z�0�8�8�:�:��� ���s � � (�(c �| � t j dt d�� d� t | |� j � D � S )z�Return an iterable over the named resources within the package. The iterable returns :class:`str` resources (e.g. files). The iterable does not recurse into subdirectories. zPimportlib.resources.contents is deprecated. Use files(anchor).iterdir() instead.r )� stacklevelc 3 �4 K � | ] }|j �� � y �w)N)�name)�.0r s r � <genexpr>zcontents.<locals>.<genexpr>? s � �� �V�*U�h�H�M�M�*U�s �)�warnings�warn�DeprecationWarningr �iterdirr s r �contentsr/ 3 s9 � � �M�M� /��� � W�-�� �*K�*S�*S�*U�V�Vr c �J � |t u rt | � dkD rt d� �y|S )Nr z5'encoding' argument required with multiple path nameszutf-8)�_MISSING�len� TypeError)r r s r r r B s2 � � �8���z�?�Q���G�� � ��Or c �L � | �t d� � t | � j |� S )Nz)anchor must be module or string, got None)r3 r �joinpathr s r r r Q s* � � �~��C�D�D�!�5��=�!�!�:�.�.r )�__doc__r+ �_commonr r �abcr �objectr1 r r r r r! r$ r/ r r � r r �<module>r; sV �� ;� � #� ��8��8� -5�X� @�:� -5�X� @�6� �W��/r