Hacked By AnonymousFox

Current Path : /proc/thread-self/root/opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //proc/thread-self/root/opt/alt/python312/lib64/python3.12/__pycache__/modulefinder.cpython-312.pyc

�

�Q�f�\����dZddlZddlZddlZddlZddlZddlZddlZdZ	dZ
dZdZdZ
dZdZiZd	�ZiZd
�Zdd�ZGd�d
�ZGd�d�Zd�Zedk(r		e�Zyy#e$red�YywxYw)z3Find modules used by a script, using introspection.�N������c�N�tj|g�j|�y�N)�packagePathMap�
setdefault�append)�packagename�paths  �3/opt/alt/python312/lib64/python3.12/modulefinder.py�AddPackagePathrs�����k�2�.�5�5�d�;�c��|t|<yr
)�replacePackageMap)�oldname�newnames  r�ReplacePackager)s
��!(��g�rc� �tjjj�tjjj	||�}|�tdj
|��|���|jtjjurddddtffS|jtjjurddddtffS|j}|jj|�r)dtjj!|�ddt"ffSt%|jtjj&�rt(}nvt%|jtjj*�rt,}nAt%|jtjj.�rt0}nddddt2ffSt5j6|�}tjj9|�d}|||d|ffS)zDAn importlib reimplementation of imp.find_module (for our purposes).NzNo module named {name!r})�name�����rb)�	importlib�	machinery�
PathFinder�invalidate_caches�	find_spec�ImportError�format�loader�BuiltinImporter�
_C_BUILTIN�FrozenImporter�
_PY_FROZEN�origin�
is_package�osr�dirname�_PKG_DIRECTORY�
isinstance�SourceFileLoader�
_PY_SOURCE�ExtensionFileLoader�_C_EXTENSION�SourcelessFileLoader�_PY_COMPILED�
_SEARCH_ERROR�io�	open_code�splitext)rr�spec�	file_path�kind�file�suffixs       r�_find_moduler>-s������"�"�4�4�6����)�)�3�3�D�$�?�D��|��4�;�;��;�F�T�R�R��{�{�i�)�)�9�9�9��T�B��J�/�/�/��{�{�i�)�)�8�8�8��T�B��J�/�/�/����I��{�{���d�#��R�W�W�_�_�Y�/�"�b�.�1I�I�I��$�+�+�y�2�2�C�C�D���	�D�K�K��!4�!4�!H�!H�	I���	�D�K�K��!4�!4�!I�!I�	J����T�B��M�2�2�2�
�<�<�	�"�D�
�W�W�
�
�i�
(��
,�F���V�T�4�0�0�0rc��eZdZdd�Zd�Zy)�ModuleNc�X�||_||_||_d|_i|_i|_yr
)�__name__�__file__�__path__�__code__�globalnames�starimports)�selfrr<rs    r�__init__zModule.__init__\s2����
���
���
���
������rc��d|j��}|j�|d|j��z}|j�|d|j��z}|dz}|S)NzModule(�, �))rBrCrD)rH�ss  r�__repr__zModule.__repr__isR���=�=�*���=�=�$��d�m�m�-�-�A��=�=�$��d�m�m�-�-�A�
��G���r)NN)rB�
__module__�__qualname__rIrN�rrr@r@Zs���rr@c��eZdZdd�Zd�Zd�Zd�Zd�Zd�Zdd�Z	dd	�Z
d
�Zd�Zdd�Z
d
�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Zy) �ModuleFinderNc��|�tj}||_i|_i|_||_d|_|�|ng|_|�|ng|_g|_y)Nr)	�sysr�modules�
badmodules�debug�indent�excludes�
replace_paths�processed_paths)rHrrXrZr[s     rrIzModuleFinder.__init__tsX���<��8�8�D���	���������
����$,�$8��b��
�.;�.G�]�R���!��rc���||jkr\t|j�D]}tdd���t|d��|D]}tt	|�d���t�yy)N�   � ��end)rX�rangerY�print�repr)rH�level�str�args�i�args      r�msgzModuleFinder.msg�sW���D�J�J���4�;�;�'���e��%�(��#�3�����d�3�i�S�)���G�
rc�t�|d}||jkr$|jdz|_|j|�yy�Nrr�rXrYrj�rHrgres   r�msginzModuleFinder.msgin��8���Q����D�J�J���+�+��/�D�K��D�H�H�d�O�rc�t�|d}||jkr$|jdz
|_|j|�yyrlrmrns   r�msgoutzModuleFinder.msgout�rprc��|jdd|�tj|�5}ddtf}|j	d|||�ddd�y#1swYyxYw)Nr�
run_scriptrr�__main__)rjr6r7r0�load_module)rH�pathname�fp�stuffs    rrtzModuleFinder.run_script�sL������L�(�+�
�\�\�(�
#�r���z�*�E����Z��X�u�=�$�
#�
#�s�A�Ac��tjj|�\}}tjj|�\}}t	j
|�5}|dtf}|j||||�ddd�y#1swYyxYw)Nr)r+r�splitr8r6r7r0rv)rHrw�dirr�extrxrys       r�	load_filezModuleFinder.load_file�sj���G�G�M�M�(�+�	��T��G�G�$�$�T�*�	��c�
�\�\�(�
#�r��$�
�+�E����T�2�x��7�$�
#�
#�s�B�B
c���|jdd||||�|j||��}|j||�\}}|j||�}|s|S|jr|j||�y)Nr�import_hook�re)rj�determine_parent�find_head_package�	load_tailrD�ensure_fromlist)	rHr�caller�fromlistre�parent�q�tail�ms	         rr�zModuleFinder.import_hook�su������M�4���5�A��&�&�v�U�&�;���(�(���6���4��N�N�1�d�#����H��:�:�� � ��H�-�rc��|jdd||�|r|dk(r|jdd�y|j}|dk\r�|jr|dz}|dk(r*|j|}||usJ�|jdd|�|S|jd�|krt
d��dj|jd�d|�}|j|}|jdd|�|S|jr*|j|}||usJ�|jdd|�|Sd|vrK|jd�}|d|}|j|}|j|k(sJ�|jdd|�|S|jdd�y)	N�r�rzdetermine_parent -> Nonerzdetermine_parent ->�.zrelative importpath too deep)
rorrrBrDrV�countr"�joinr{�rfind)rHr�re�pnamer�rhs      rr�zModuleFinder.determine_parent�s����
�
�1�(�&�%�8���!���K�K��5�6�������A�:������
����z����e�,����'�'�'����A�4�f�=��
��{�{�3��%�'�!�"@�A�A��H�H�U�[�[��-�g��v�6�7�E��\�\�%�(�F��K�K��0�&�9��M��?�?��\�\�%�(�F��V�#�#�#��K�K��0�&�9��M��%�<����C� �A��"�1�I�E��\�\�%�(�F��?�?�e�+�+�+��K�K��0�&�9��M����A�1�2�rc��|jdd||�d|vr|jd�}|d|}||dzd}n|}d}|r|j�d|��}n|}|j|||�}|r|j	dd||f�||fS|r2|}d}|j|||�}|r|j	dd||f�||fS|j	dd|�td|z��)	Nr�r�r�rrzfind_head_package ->�"raise ImportError: No module named�No module named )ro�findrB�
import_modulerrr")rHr�rrh�headr��qnamer�s        rr�zModuleFinder.find_head_package�s����
�
�1�)�6�4�8��$�;��	�	�#��A����8�D���!���:�D��D��D��%����5�E��E����t�U�F�3����K�K��1�A�t�9�=��d�7�N���E��F��"�"�4���7�A�����A�5��4�y�A��$�w�����A�;�U�C��,�u�4�5�5rc�L�|jdd||�|}|rx|jd�}|dkrt|�}|d|||dzd}}|j�d|��}|j	|||�}|s!|jdd|�t
d|z��|r�x|jdd|�|S)	Nr�r�r�rrr�r�zload_tail ->)ror��lenrBr�rrr")rHr�r�r�rhr��mnames       rr�zModuleFinder.load_tail�s����
�
�1�k�1�d�+�
����	�	�#��A��1�u�#�d�)�a��b�q��4��!���:�$�D� �z�z�4�0�E��"�"�4���2�A�����A�C�U�K�!�"4�u�"<�=�=��	
���A�~�q�)��rc��|jdd|||�|D]s}|dk(r+|r�|j|�}|s�|j||d��3t||�r�@|j�d|��}|j|||�}|r�gt
d|z��y)Nr�r��*rr�r�)rj�find_all_submodulesr��hasattrrBr�r")rHr�r��	recursive�sub�all�subname�submods        rr�zModuleFinder.ensure_fromlist�s�������%�q�(�I�>��C��c�z� ��2�2�1�5�C���,�,�Q��Q�7��Q��_�%&�Z�Z��5���+�+�C��!�<���%�&8�7�&B�C�C�rc�
�|jsyi}g}|tjjddz
}|tjjddz
}|tjj
ddz
}|jD]R}	t
j|�}|D]5}d}|D]}t|�}	||	d|k(s�|d|	}n|s�+|dk7s�1|||<�7�T|j�S#t$r|jdd|�Y��wxYw)Nrzcan't list directoryrI)rDrr�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXESr+�listdir�OSErrorrjr��keys)
rHr�rV�suffixesr|�namesr�mod�suff�ns
          rr�z ModuleFinder.find_all_submoduless���z�z�������I�'�'�:�:�1�=�=���I�'�'�7�7��:�:���I�'�'�9�9�!�<�<���:�:�C�
��
�
�3�������$�D��D�	�A��Q�B�C�y�D�(�"�3�Q�B�i���	%�
�3�*�,�#&�G�C�L��
��|�|�~����
�����2�C�8��
�s�C#�#D�Dc�r�|jdd|||�	|j|}|jdd|�|S#t$rYnwxYw||jvr|jdd�y|r|j
�|jdd�y	|j
||xr|j
|�\}}}n"#t$r|jddd�YywxYw	|j||||�}|r)|j�n#|r|j�wwxYw|r
t|||�|jdd|�|S)Nrr�zimport_module ->zimport_module -> None)rorVrr�KeyErrorrWrD�find_moduler"rv�close�setattr)rH�partname�fqnamer�r�rxrwrys        rr�zModuleFinder.import_module$sD���
�
�1�o�x���@�	����V�$�A�
�K�K��-�q�1��H��	�	��	��
�T�_�_�$��K�K��2�3���f�o�o�-��K�K��2�3��	�"&�"2�"2�8�39�3M�f�o�o�v�#W��B��%���	��K�K��-�t�4��	��	�� � ���X�u�=�A�����
������
�����F�H�a�(����A�)�1�-��s-�;�	A�A�
%B3�3C�C�C=�=Dc���|\}}}|jdd||xrd|�|tk(r'|j||�}|jdd|�|S|tk(rt|j
�|d�}	n_|tk(rT	|j
�}
tjj|
|i�tjt|
�dd�}	nd}	|j!|�}||_|	r6|j$r|j'|	�}	|	|_|j+|	|�|jdd|�|S#t$r%}|jddt|�z|��d}~wwxYw)Nrrvrxzload_module ->�execzraise ImportError: �)ror-�load_packagerrr0�compile�readr4r�_bootstrap_external�
_classify_pycr"rf�marshal�loads�
memoryview�
add_modulerCr[�replace_paths_in_coderE�	scan_code)rHr�rxrw�	file_infor=�mode�typer��co�data�excs            rrvzModuleFinder.load_moduleDsN��&����d��
�
�1�m�V�R�[�D�(�C��>�!��!�!�&�(�3�A��K�K��+�Q�/��H��:�������H�f�5�B�
�\�
!�
��w�w�y���-�-�;�;�D�&�"�M����z�$�/���4�5�B��B��O�O�F�#����
�
��!�!��/�/��3���A�J��N�N�2�q�!����A�'��+�����
����A�4�s�3�x�?��J���
�s�?1D9�9	E'� E"�"E'c��||jvri|j|<|rd|j||j<yd|j|d<y)Nr�-)rWrB)rHrr�s   r�_add_badmodulezModuleFinder._add_badmoduleasI���t���&�$&�D�O�O�D�!��56�D�O�O�D�!�&�/�/�2�)*�D�O�O�D�!�#�&rc	��||jvr|j||�y	|j|||��|rH|D]B}|dz|z}||jvr|j||��,	|j|||g|���Dyy#t$r8}|j	ddt|��|j||�Yd}~��d}~wwxYw#t$r8}|j	ddt|��|j||�Yd}~yd}~wt$r8}|j	ddt|��|j||�Yd}~yd}~wwxYw)Nr�r�rzImportError:zSyntaxError:)rWr�r�r"rjrf�SyntaxError)rHrr�r�rer��fullnamerjs        r�_safe_import_hookzModuleFinder._safe_import_hookis;���4�?�?�"�����f�-��	>����T�6���7��#�C�#�c�z�C�/�H��4�?�?�2��+�+�H�f�=� �>��(�(��v��u�E�(�J�
$���'�>�����N�C��H�=��+�+�H�f�=�=��>���	.��H�H�Q���C��1�����f�-�-���	.��H�H�Q���C��1�����f�-�-��	.�s;�C�(B�	C�.B>�>C�	E�.D�E�.E�Ec#�K�tj|�D]	}d|ff���tj|�D]\}}}|dk(r	d||ff���d|||ff���y�w)N�storer�absolute_import�relative_import)�dis�_find_store_names�
_find_imports)rHr�rrer�s     r�scan_opcodeszModuleFinder.scan_opcodes�sm�����)�)�"�-�D��D�7�"�"�.�%(�%6�%6�r�%:�!�D�%����z�'�(�D�)9�9�9�'�%��4�)@�@�@�	&;�s�AAc���|j}|j}||�D�]�\}}|dk(r|\}d|j|<� |dk(�r|\}}d}	|�d|vrd}	|D�
cgc]
}
|
dk7s�	|
��}}
|j|||d��|	s�bd}|jr+|j
j
|jdz|z�}|�|j
j
|�}|�i|jj|j�|jj|j�|j���d|j|<��#d|j|<��4|dk(rS|\}}}|r|j||||����X|j||��}
|j|
jd|d�����t|��|jD]*}t|t|��s�|j!||��,ycc}
w)	Nr�rr�rr�r�r�r�)�co_coder�rFr�rDrV�getrB�updaterGrEr��RuntimeError�	co_constsr.r�r�)rHr�r��code�scanner�whatrgrr��	have_star�f�mmrer��cs               rr�zModuleFinder.scan_code�s����z�z���#�#��!�"�+�J�D�$��w�����&'��
�
�d�#��*�*�!%���$��	��'��h��$%�	�+3�@�8�a�q�C�x��8�H�@��&�&�t�Q���&�B���B��z�z�"�\�\�-�-�a�j�j�3�.>��.E�F���z�!�\�\�-�-�d�3���~��
�
�,�,�R�^�^�<��
�
�,�,�R�^�^�<��;�;�.�23�A�M�M�$�/�./��
�
�d�+��*�*�(,�%��x����*�*�4��H�E�*�J�!�2�2�1�E�2�B�F��*�*�6�?�?�D�(�RS�*�T�#�4�(�(�Q&�T���A��!�T�"�X�&����q�!�$���A As�
G3�%G3c���|jdd||�tj|�}|r|}|j|�}||_|g|_|j
tj|g�z|_|jd|j
�\}}}	|j||||�|jdd|�||r|j�SS#|r|j�wwxYw)Nrr�rIzload_package ->)rorr�r�rCrDrr�rvrrr�)rHr�rwrr�rx�bufrys        rr�zModuleFinder.load_package�s����
�
�1�n�f�h�7�#�'�'��/����F��O�O�F�#����
��Z��
��Z�Z�.�"4�"4�V�R�"@�@��
��)�)�*�a�j�j�A���C��	����V�R��e�4��K�K��,�a�0������
���r����
��s�(C�C(c�t�||jvr|j|St|�x|j|<}|Sr
)rVr@)rHr�r�s   rr�zModuleFinder.add_module�s9���T�\�\�!��<�<��'�'�#)�&�>�1����V��q��rc��|�|jdz|z}n|}||jvr|jdd|�t|��|�*|tj
vrddddtffS|j}t||�S)Nr�rzfind_module -> Excludedr)	rBrZrrr"rU�builtin_module_namesr&rr>)rHrrr�r�s     rr�zModuleFinder.find_module�s��������s�*�4�/�H��H��t�}�}�$��K�K��4�h�?��d�#�#��<��s�/�/�/��d�R��Z�$8�9�9��9�9�D��D�$�'�'rc	��t�tddz�tddz�t|jj��}|D]U}|j|}|jrtdd��n
tdd��td|z|j
xsd	��W|j
�\}}|r_t�td
�|D]E}t|j|j��}td|dd
j|���G|rmt�tdd��td�|D]E}t|j|j��}td|dd
j|���Gyy)z�Print a report to stdout, listing the found modules with their
        paths, as well as modules that are missing, or seem to be missing.
        z
  %-25s %s)�Name�File)�----r��Pr_r`r�z%-25srzMissing modules:�?z
imported fromrKz7Submodules that appear to be missing, but could also bez#global names in the parent package:N)	rc�sortedrVr�rDrC�any_missing_mayberWr�)rHr��keyr��missing�mayber�modss        r�reportzModuleFinder.report�sG��	��
�l�-�-�.�
�l�-�-�.��d�l�l�'�'�)�*���C����S�!�A��z�z��c�s�#��c�s�#��'�C�-����!1�r�2�
��/�/�1������G��$�%����d�o�o�d�3�8�8�:�;���c�4��$�)�)�D�/�B� ���G��K�QT�U��7�8����d�o�o�d�3�8�8�:�;���c�4��$�)�)�D�/�B��	rc�2�|j�\}}||zS)z�Return a list of modules that appear to be missing. Use
        any_missing_maybe() if you want to know which modules are
        certain to be missing, and which *may* be missing.
        )r�)rHr�r�s   r�any_missingzModuleFinder.any_missing
s ��
�/�/�1�������rc��g}g}|jD]�}||jvr�|jd�}|dkr|j|��:||dzd}|d|}|jj|�}|�b||j|vr|j|���||jvr��|jr|j|���|j|���|j|���|j�|j�||fS)a�Return two lists, one with modules that are certainly missing
        and one with modules that *may* be missing. The latter names could
        either be submodules *or* just global names in the package.

        The reason it can't always be determined is that it's impossible to
        tell which names are imported when "from module import *" is done
        with an extension module, short of actually importing it.
        r�rrN)	rWrZr�r
rVr�rFrG�sort)rHr�r�rrhr��pkgname�pkgs        rr�zModuleFinder.any_missing_maybes��������O�O�D��t�}�}�$���
�
�3��A��1�u����t�$���1�Q�3�4�j�G��2�A�h�G��,�,�"�"�7�+�C����d�o�o�d�3�3��N�N�4�(�����/���_�_��L�L��&��N�N�4�(����t�$�=$�>	����
�
�
����~�rc��tjj|j�x}}|jD])\}}|j|�s�||t
|�dz}n|jr]||jvrO||k7r|jdd|�d|���n|jdd|�d��|jj|�t|j�}tt
|��D]2}t||t|��s�|j!||�||<�4|j#t%|�|��S)Nrzco_filename z changed to z remains unchanged)r��co_filename)r+r�normpathrr[�
startswithr�rXr\rrr
�listr�rbr.r�r��replace�tuple)rHr��new_filename�original_filenamer��r�constsrhs        rr�z"ModuleFinder.replace_paths_in_codeCs&��+-�7�7�+;�+;�B�N�N�+K�K��(��&�&�D�A�q� �+�+�A�.� �#4�S��V�W�#=�=���'�
�:�:�+�4�3G�3G�G��0�0����A�'8�� H�I����A�'8� ;�<�� � �'�'�(9�:��b�l�l�#���s�6�{�#�A��&��)�T�"�X�.� �6�6�v�a�y�A��q�	�$��z�z�E�&�M�|�z�L�Lr)NrNN)NNr)r)rr
)rBrOrPrIrjrorrrtr~r�r�r�r�r�r�r�rvr�r�r�r�r�r�r�r�r�r�r�rQrrrSrSrs���
"����>�8�	�!�F6�6
�D��8�@�:+�>�4A�/%�b�*�(�$ C�D�,�\MrrSc�d�ddl}	|jtjddd�\}}d}d}g}g}|D][\}}	|dk(r|dz}|dk(rd}|dk(r"||	jtj�z}|dk(rd}|dk(s�K|j|	��]|sd	}
n|d}
tjdd}tjj|
�|d<||z}|dkDr't	d
�|D]}t	dt|���t|||�}
|ddD]O}|dk(rd}�|r2|ddd
k(r|
j|ddddg��-|
j|��?|
j|��Q|
j|
�|
j!�|
S#|j$r}t	|�Yd}~yd}~wwxYw)Nrrzdmp:qx:z-dz-mz-pz-qz-xzhello.pyzpath:r^���z.*r�)�getoptrU�argv�errorrcr{r+�pathsepr
rr,rdrSr�r~rtr�)r�optsrgrjrX�domods�addpath�exclude�o�a�scriptr�item�mfris               r�testr[s������]�]�3�8�8�A�B�<��;�
��d�
�E�
�F��G��G����1���9��A�I�E���9��F���9������
�
� 3�3�G���9��E���9��N�N�1�������a����8�8�A�;�D��g�g�o�o�f�%�D��G��T�>�D��q�y�
�g���D��%��d��$��
�d�E�7�	+�B��A�B�x���$�;��F����2�3�x�4�����s�3�B�x���u�5����s�#��L�L�����M�M�&���I�I�K�
�I��g�<�<��
�c�
����s�&F�F/�F*�*F/ruz
[interrupted]r
)�__doc__r��importlib._bootstrap_externalr�importlib.machineryr�r+r6rUr5r0r4r2r-r&r(rrrrr>r@rSrrBr�KeyboardInterruptrcrQrr�<module>r s���9�
�$���	�	�
��
�
�
�������
�
�
�
���<���)�*1�Z��0fM�fM�R8�v�z��!�
�V�����!�
�� �!�s�A!�!
A1�0A1

Hacked By AnonymousFox1.0, Coded By AnonymousFox