Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.144.84.91
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : calltip.cpython-311.pyc
�

Tfc����dZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
Gd�d��Zd�ZdZ
d	Zd
Zejd��ZdZd
Zd�ZedkrddlmZedd���dSdS)z�Pop up a reminder of how to call a function.

Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
�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  �8/usr/local/python-3.11/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�0�|�d��dS)z9The user selected the menu entry or hotkey, open the tip.T�break��open_calltiprs  r�force_open_calltip_eventz Calltip.force_open_calltip_event)s�����$�����wrc�0�|�d��dS)z�Happens when it would be nice to open a calltip, but not really
        necessary, for example after an opening bracket, so function calls
        won't be made.
        FNrrs  r�try_open_calltip_eventzCalltip.try_open_calltip_event.s��
	
���%� � � � � rc�^�|jr#|jjr|�d��dSdSdS)NF)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)z�Maybe close an existing calltip and maybe open a new calltip.

        Called from (force_open|try_open|refresh)_calltip_event functions.
        �insert�(Nr�.����)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�7C�C�Cc���	|jjjjj}n#t
$rd}YnwxYw|r|�dd|fi��Stt|����S)aDReturn the argument list and docstring of a function or class.

        If there is a Python subprocess, get the calltip there.  Otherwise,
        either this fetch_tip() is running in the subprocess or it was
        called in an IDLE running without the subprocess.

        The subprocess environment is that of the most recently run script.  If
        two unrelated modules are being edited some calltips in the current
        module may be inoperative if the module was not the last to run.

        To find methods, fetch_tip must be fed a fully qualified name.

        N�exec�get_the_calltip)	r	�flist�pyshell�interp�rpcclt�AttributeError�
remotecall�get_argspec�
get_entity)rr=rEs   rr6zCalltip.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%rr6�rrrrs�������@�@�@�@�$�$�$�2�2�2�'�'�'�'�
���
!�!�!�%�%�%�1I�1I�1I�f7�7�7�7�7rrc��|r<itj�tj�}	t	||��S#t
$rYdSwxYwdS)zwReturn the object corresponding to expression evaluated
    in a namespace spanning sys.modules and __main.dict__.
    N)�sys�modules�__main__�__dict__�eval�
BaseException)r=�	namespaces  rrIrI�sc����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)a�Return a string describing the signature of a callable object, or ''.

    For Python-coded functions and methods, the first line is introspected.
    Delete 'self' parameter for classes (.__init__) and bound methods.
    The next lines are the first lines of the doc string up to the first
    empty line or _MAX_LINES.    For builtins, this typically includes
    the arguments in addition to the return value.
    �Nz())�subsequent_indent�
�z...)�__call__rT�
isinstance�types�
MethodType�str�inspect�	signature�	Exception�
startswith�_invalid_method�type�_default_callable_argspec�len�	_MAX_COLS�textwrap�wrap�_INDENT�getdocr/�
_MAX_LINES�strip�append�join)	�ob�ob_call�fobr>�err�msg�lines�doc�lines	         rrHrH�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'rQ)�mainzidlelib.idle_test.test_calltip�)�	verbosity)�__doc__rQrb�rerOrkr_�idlelibr�idlelib.hyperparserrrrIrjrorm�compile�_first_paramrhrfrHrJ�unittestr{rMrr�<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
© 2025 GrazzMean