관리-도구
편집 파일: calltip.cpython-37.opt-2.pyc
B YI~d� � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm Z G dd� d�Z dd� ZdZd Z d Ze�d�ZdZd ZdZdd� Zedkr�d dlmZ eddd� dS )� N)� calltip_w)�HyperParserc @ sX e Zd Zddd�Zdd� Zdd� Zddd �Zd d� Zdd � Zdd� Z dd� Z dd� ZdS )�CalltipNc C s0 |d krd | _ n|| _ |j| _d | _| j| _d S )N)�editwin�text�active_calltip�_make_tk_calltip_window�_calltip_window)�selfr � r �4/opt/alt/python37/lib64/python3.7/idlelib/calltip.py�__init__ s zCalltip.__init__c C s d | _ d S )N)r )r r r r �close s z Calltip.closec C s t �| j�S )N)r Z CalltipWindowr )r r r r r s zCalltip._make_tk_calltip_windowc C s | j r| j �� d | _ d S )N)r Zhidetip)r �eventr r r �remove_calltip_window$ s zCalltip.remove_calltip_windowc C s | � d� dS )NT�break)�open_calltip)r r r r r �force_open_calltip_event) s z Calltip.force_open_calltip_eventc C s | � d� d S )NF)r )r r r r r �try_open_calltip_event. s zCalltip.try_open_calltip_eventc C s | j r| j jr| �d� d S )NF)r Z tipwindowr )r r r r r �refresh_calltip_event5 s zCalltip.refresh_calltip_eventc C s� | � � t| jd�}|�d�}|s&d S |�|d � |�� }|sDd S |sZ|�d�dkrZd S | �|�}|sld S | �� | _ | j � ||d |d � d S )N�insert�(r ���� )r r r Zget_surrounding_bracketsZ set_indexZget_expression�find� fetch_tipr r Zshowtip)r Z evalfuncsZhpZ sur_paren� expression�argspecr r r r 9 s zCalltip.open_calltipc C sR y| j jjjj}W n tk r* d }Y nX |rB|�dd|fi �S tt|��S d S )N�execZget_the_calltip) r �flistZpyshellZinterp�rpcclt�AttributeErrorZ remotecall�get_argspec� get_entity)r r r r r r r L s zCalltip.fetch_tip)N)N)�__name__� __module__�__qualname__r r r r r r r r r r r r r r s r c C s4 | r0t jtj�}y t| |�S tk r. d S X d S )N)�sys�modules�__main__�__dict__�eval� BaseException)r � namespacer r r r# e s r# �U � z z(?<=\()\w*\,?\s*zSee source or doczinvalid method signaturez0 # '/' marks preceding args as positional-only.c C s� y | j }W n tk r dS X t|tj�r0|n| }ytt�|��}W n< tk r� } zt|�}|� t �rnt S d}W d d }~X Y nX d|kr�t|�ttt � k r�|t 7 }t|t�r�|dkr�t}t|�tkr�tj|ttd�n|r�|gng }t|tj�� r�|j}nt| dd�}|�rlxZ|�dt�d t� D ]B}|�� }|�s:P t|�tk�r\|d td � d }|�|� �q&W d�|�}|�p~tS ) N� �/z())�subsequent_indent�__doc__� � z...)�__call__r, � isinstance�types� MethodType�str�inspectZ signature� Exception� startswith�_invalid_method�len� _MAX_COLS�_argument_positional�type�_default_callable_argspec�textwrap�wrap�_INDENTr3 �getattr�split� _MAX_LINES�strip�append�join) ZobZob_callZfobr �err�msg�lines�doc�liner r r r"