Your IP : 216.73.216.85


Current Path : /opt/alt/python38/lib64/python3.8/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/idlelib/__pycache__/calltip.cpython-38.opt-2.pyc

U

i�fc�@s�ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	Gdd�d�Z
dd�ZdZd	Z
d
Ze�d�ZdZd
Zdd�Zedkr�ddlmZeddd�dS)�N)�	calltip_w)�HyperParserc@sXeZdZddd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)�CalltipNcCs0|dkrd|_n||_|j|_d|_|j|_dS�N)�editwin�text�active_calltip�_make_tk_calltip_window�_calltip_window)�selfr�r�4/opt/alt/python38/lib64/python3.8/idlelib/calltip.py�__init__szCalltip.__init__cCs
d|_dSr)r
�rrrr
�closesz
Calltip.closecCst�|j�Sr)rZ
CalltipWindowrrrrr
r	 szCalltip._make_tk_calltip_windowcCs|jr|j��d|_dSr)rZhidetip�rZeventrrr
�remove_calltip_window$s
zCalltip.remove_calltip_windowcCs|�d�dS)NT�break��open_calltiprrrr
�force_open_calltip_event)s
z Calltip.force_open_calltip_eventcCs|�d�dS�NFrrrrr
�try_open_calltip_event.szCalltip.try_open_calltip_eventcCs|jr|jjr|�d�dSr)rZ	tipwindowrrrrr
�refresh_calltip_event5szCalltip.refresh_calltip_eventcCs�t|jd�}|�d�}|s&|��dS|jr`tt|d�d��\}}||f|jj|jj	fkr`dS|�
|d�z|��}Wntk
r�d}YnX|s�dS|��|s�|�
d�dkr�dS|�|�}|s�dS|��|_|j�||d|d�dS)N�insert�(r�.����)rrZget_surrounding_bracketsrr�map�int�splitZ	parenlineZparencolZ	set_indexZget_expression�
ValueError�find�	fetch_tipr
Zshowtip)rZ	evalfuncsZhpZ	sur_parenZopener_lineZ
opener_col�
expression�argspecrrr
r9s6
��


zCalltip.open_calltipcCsRz|jjjjj}Wntk
r*d}YnX|rB|�dd|fi�Stt|��SdS)N�execZget_the_calltip)	rZflistZpyshellZinterp�rpcclt�AttributeErrorZ
remotecall�get_argspec�
get_entity)rr%r(rrr
r$ls
�zCalltip.fetch_tip)N)N)�__name__�
__module__�__qualname__rrr	rrrrrr$rrrr
rs
	
3rcCs8|r4tjtj�}zt||�WStk
r2YdSXdSr)�sys�modules�__main__�__dict__�eval�
BaseException)r%�	namespacerrr
r+�sr+�U�z    z(?<=\()\w*\,?\s*zSee source or doczinvalid method signaturec	
CsLz
|j}Wntk
r YdSXt|tj�r2|n|}ztt�|��}WnDtk
r�}z&t|�}|�	t
�rxt
WY�
Sd}W5d}~XYnXt|t�r�|dkr�t}t
|�tkr�tj|ttd�n|r�|gng}t�|�}|�r8|�dt�dt�D]D}|��}|�s
�q8t
|�tk�r,|dtd�d}|�|�q�d�|�}|�pJtS)N�z())Zsubsequent_indent�
�z...)�__call__r4�
isinstance�types�
MethodType�str�inspectZ	signature�	Exception�
startswith�_invalid_method�type�_default_callable_argspec�len�	_MAX_COLS�textwrapZwrap�_INDENTZgetdocr!�
_MAX_LINES�strip�append�join)	ZobZob_callZfobr&�err�msg�lines�doc�linerrr
r*�s:



��

r*r1)�mainzidlelib.idle_test.test_calltip�)�	verbosity)r1r@�rer/rHr=ZidlelibrZidlelib.hyperparserrrr+rGrJrI�compileZ_first_paramrErCr*r,ZunittestrSrrrr
�<module>s&s
1