관리-도구
편집 파일: importer.cpython-39.opt-1.pyc
a '�Dg� � @ s� d dl Z d dlmZ d dlmZmZ d dlmZ eed�dd�Z deeee e d�d d �Zeee d�dd �Zdeee eee e d�dd�ZdS )� N)� ModuleType)�Optional�Sequence)�util)�module_name�returnc C s t �| �S )N)� importlib� import_module)r � r �6/usr/lib/python3.9/site-packages/cloudinit/importer.pyr s r )r �attrsr c C s6 d}|s|S t �| �}|D ]}t||�r|d7 }q|S )Nr � )r r �hasattr)r r Zfound_attrs�mod�attrr r r �_count_attrs s r )�mod_namer c C s� d| � � kr| dd� } | �d�s,d| � �} i }tj�d�}|r�|jr�|jD ]}|�t�|�� qL|�� D ]}|� � | � � krj| S qj| S )zECheck the importable datasource modules for a case-insensitive match.znocloud-netN���Z DataSourcezcloudinit.sources) �lower� startswithr r � find_spec�submodule_search_locations�updateZget_modules_from_dir�values)r �modules�spec�dir�moduler r r �"match_case_insensitive_module_name# s r )� base_name�search_paths�required_attrsr c C sj |sg }g }g }|D ]L}d� td|| g��}|�|� tj�|�sDqt||�t|�kr|�|� q||fS )zFinds specified modules�.N)�join�filter�appendr r r r �len)r r r! Zlookup_pathsZfound_paths�path� full_pathr r r �find_module7 s r) )N)N)r �typesr �typingr r Z cloudinitr �strr �intr r �tupler) r r r r �<module> s"