Current File : //usr/local/apps/python3/lib/python3.11/idlelib/__pycache__/calltip.cpython-311.opt-2.pyc
�

�Kec����	ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	Gd�d��Z
d�ZdZdZ
d	Zejd
��ZdZdZd
�ZedkrddlmZedd���dSdS)�N)�	calltip_w)�HyperParserc�H�eZdZdd�Zd�Zd�Zdd�Zd�Zd�Zd�Z	d	�Z
d
�ZdS)�CalltipNc�h�|�	d|_dS||_|j|_d|_|j|_dS�N)�editwin�text�active_calltip�_make_tk_calltip_window�_calltip_window)�selfr	s  �9/usr/local/apps/python3/lib/python3.11/idlelib/calltip.py�__init__zCalltip.__init__s;���?��D�L�L�L�"�D�L���D�I�"&�D��#'�#?�D� � � �c��d|_dSr)r
�rs r�closez
Calltip.closes��#����rc�4�tj|j��Sr)r�
CalltipWindowr
rs rrzCalltip._make_tk_calltip_window s���&�t�y�1�1�1rc�X�|jr"|j���d|_dSdSr)r�hidetip�r�events  r�remove_calltip_windowzCalltip.remove_calltip_window$s:����	'���'�'�)�)�)�"&�D����	'�	'rc�2�	|�d��dS)NT�break��open_calltiprs  r�force_open_calltip_eventz Calltip.force_open_calltip_event)s��C����$�����wrc�2�	|�d��dS�NFrrs  r�try_open_calltip_eventzCalltip.try_open_calltip_event.s#��	�	
���%� � � � � rc�^�|jr#|jjr|�d��dSdSdSr")r�	tipwindowrrs  r�refresh_calltip_eventzCalltip.refresh_calltip_event5sH����	%�4�#6�#@�	%����e�$�$�$�$�$�	%�	%�	%�	%rc���	t|jd��}|�d��}|s|���dS|jrQtt|d�d����\}}||f|jj|jj	fkrdS|�
|d��	|���}n#t$rd}YnwxYw|sdS|���|s|�
d��dkrdS|�|��}|sdS|���|_|j�||d|d��dS)N�insert�(r�.����)rr	�get_surrounding_bracketsrr�map�int�split�	parenline�parencol�	set_index�get_expression�
ValueError�find�	fetch_tipr
�showtip)r�	evalfuncs�hp�	sur_paren�opener_line�
opener_col�
expression�argspecs        rrzCalltip.open_calltip9s���	����x�
0�
0���/�/��4�4�	��	��&�&�(�(�(��F���	�&)�#�y��|�/A�/A�#�/F�/F�&G�&G�#�K���j�)��$�.��0C�0L�M�N�N���
���Y�q�\�"�"�"�	��*�*�,�,�J�J���	�	�	��J�J�J�	�����	�
�F�	
�"�"�$�$�$��	�j�o�o�c�2�2�b�8�8��F��.�.��,�,���	��F�"�2�2�4�4�����#�#�G�Y�q�\�9�Q�<�H�H�H�H�Hs�8C
�
C�Cc���		|jjjjj}n#t
$rd}YnwxYw|r|�dd|fi��Stt|����S)N�exec�get_the_calltip)	r	�flist�pyshell�interp�rpcclt�AttributeError�
remotecall�get_argspec�
get_entity)rr>rFs   rr7zCalltip.fetch_tipls���	�	��\�'�/�6�=�F�F���	�	�	��F�F�F�	�����	7��$�$�V�->�&0�]�B�8�8�
8��z�*�5�5�6�6�6s��.�.r)�__name__�
__module__�__qualname__rrrrr r#r&rr7�rrrrs�������@�@�@�@�$�$�$�2�2�2�'�'�'�'�
���
!�!�!�%�%�%�1I�1I�1I�f7�7�7�7�7rrc��	|r<itj�tj�}	t	||��S#t
$rYdSwxYwdSr)�sys�modules�__main__�__dict__�eval�
BaseException)r>�	namespaces  rrJrJ�sh�����8�s�{�8�h�&7�8�	�	��
�I�.�.�.���	�	�	��4�4�	����	�s�/�
=�=�U�z    z(?<=\()\w*\,?\s*zSee source or doczinvalid method signaturec��		|j}n#t$rYdSwxYwt|tj��r|n|}	tt
j|����}nN#t$rA}t|��}|�	t��rtcYd}~Sd}Yd}~nd}~wwxYwt|t��r
|dkrt}t|��tkr!tj|tt"���n|r|gng}t
j|��}|r�|�dt(��dt(�D]\}|���}|snCt|��tkr|dtdz
�dz}|�|���]d�|��}|ptS)N�z())�subsequent_indent�
�z...)�__call__rU�
isinstance�types�
MethodType�str�inspect�	signature�	Exception�
startswith�_invalid_method�type�_default_callable_argspec�len�	_MAX_COLS�textwrap�wrap�_INDENT�getdocr0�
_MAX_LINES�strip�append�join)	�ob�ob_call�fobr?�err�msg�lines�doc�lines	         rrIrI�s������+���������r�r����� ���)9�:�:�
B�'�'��C���g�'��,�,�-�-���������#�h�h���>�>�/�*�*�	�"�"�"�"�"�"�"��G�G�G�G�G�G����������#�t���,��D���+���G���y�(�(��]�7�I��
I�
I�
I�
I�;B�.J�w�i�i��
��.��
�
�C�
���I�I�d�J�/�/����<�	�	�D��:�:�<�<�D��
����4�y�y�9�$�$��O�i�!�m�O�,�u�4���L�L�������i�i����G��/�/�/s/��
��!A�
B(�'/B#�B(�B#�#B(rR)�mainzidlelib.idle_test.test_calltip�)�	verbosity)rRrc�rerPrlr`�idlelibr�idlelib.hyperparserrrrJrkrprn�compile�_first_paramrirgrIrK�unittestr|rNrr�<module>r�s'�����������	�	�	�	�
�
�
�
���������������+�+�+�+�+�+�p7�p7�p7�p7�p7�p7�p7�p7�f���
�	�
�
�
���r�z�-�.�.��/��,��.0�.0�.0�b�z����������D�	)�Q�7�7�7�7�7�7��r