Sindbad~EG File Manager
�
%Μgc����dZddlZddlZddlZddlZddlZddlZddlmZddl m
Z
Gd�d�Zd�ZdZ
d Zd
Zej d�ZdZd
Zd�Zedk(rddlmZedd��yy)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�F�eZdZdd�Zd�Zd�Zdd�Zd�Zd�Zd�Z d �Z
d
�Zy)�CalltipNc�x�|�d|_y||_|j|_d|_|j|_y�N)�editwin�text�active_calltip�_make_tk_calltip_window�_calltip_window)�selfr s �,/usr/local/lib/python3.12/idlelib/calltip.py�__init__zCalltip.__init__s6���?��D�L�"�D�L����D�I�"&�D��#'�#?�#?�D� �c��d|_yr)r
�rs r�closez
Calltip.closes
��#��rc�@�tj|j�Sr)r�
CalltipWindowr
rs rrzCalltip._make_tk_calltip_window s���&�&�t�y�y�1�1rc�`�|jr"|jj�d|_yyr)r�hidetip�r�events r�remove_calltip_windowzCalltip.remove_calltip_window$s*��������'�'�)�"&�D��rc�&�|jd�y)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�����$��rc�&�|jd�y)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�n�|jr)|jjr|jd�yyy)NF)r� tipwindowrrs r�refresh_calltip_eventzCalltip.refresh_calltip_event5s0�����4�#6�#6�#@�#@����e�$�$A�rc��t|jd�}|jd�}|s|j�y|jrWtt|djd��\}}||f|jj|jjfk(ry|j|d� |j�}|sy|j�|s|jd�dk7ry|j|�}|sy|j�|_|jj!||d|d�y#t$rd}Y��wxYw)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_calltip9sD��
����x�
0���/�/��4� ���&�&�(�����&)�#�y��|�/A�/A�#�/F�&G�#�K���j�)��$�$�.�.��0C�0C�0L�0L�M�N��
���Y�q�\�"� ��*�*�,�J��
�
�"�"�$��j�o�o�c�2�b�8���.�.��,����"�2�2�4������#�#�G�Y�q�\�9�Q�<�H��/� ��J� �s�3D:�:E�Ec��� |jjjjj}|r|j
dd|fi�Stt|��S#t
$rd}Y�8wxYw)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_tiplst�� ��\�\�'�'�/�/�6�6�=�=�F���$�$�V�->�&0�]�B�8�
8��z�*�5�6�6��
� ��F� �s�4A!�!A/�.A/r)�__name__�
__module__�__qualname__rrrrr r"r%rr6�rrrrs2��@�$�2�'�
�
!�%�1I�f7rrc��|r/itj�tj�} t ||�Sy#t
$rYywxYw)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�sM���8�s�{�{�8�h�&7�&7�8� � ��
�I�.�.���� �� �s�3� ?�?�U�z z(?<=\()\w*\,?\s*zSee source or doczinvalid method signaturec�� |j}t|tj�r|n|} tt
j|��}t|t�r|dk(rt}t|�tkDr tj |tt"��n|r|gng}t
j$|�}|rh|j'dt(�dt(D]H}|j+�}|sn4t|�tkDr|dtdz
dz}|j-|��Jdj/|�}|xstS#t$rYywxYw#t$r8}t|�}|jt�rtcYd}~Sd}Yd}~��9d}~wwxYw)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�sV����+�+�� ���)9�)9�:�'��C���g�'�'��,�-���#�t���D��+���G��y�(��]�]�7�I��
I�;B�w�i��
��.�.��
�C�
��I�I�d�J�/���<�D��:�:�<�D����4�y�9�$��O�i�!�m�,�u�4���L�L���
=��i�i���G��/�/�/��E��������#�h���>�>�/�*�"�"��G���s4�D9�E�9 E�E� F �%F�6F �<F�F rQ)�mainzidlelib.idle_test.test_calltip�)� verbosity)�__doc__rQrb�rerOrkr_�idlelibr�idlelib.hyperparserrrrIrjrorm�compile�_first_paramrhrfrHrJ�unittestr{rMrr�<module>r�s������ �
����+�p7�p7�f�
� �
�
�
���r�z�z�-�.��/��,��.0�b�z���� )�Q�7�r
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists