ok
Direktori : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/ |
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/calltip.cpython-36.pyc |
3 *j�a� � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddl Z G dd� d�Zdd� Zd Z d ZdZejd �ZdZdZdZdd� Zedkr�ddlmZ eddd� dS )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 @ 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/python36/lib64/python3.6/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| j�S )N)r Z CalltipWindowr )r r r r r s zCalltip._make_tk_calltip_windowc C s | j r| j j� d | _ d S )N)r Zhidetip)r �eventr r r �_remove_calltip_window$ s zCalltip._remove_calltip_windowc C s | j d� dS )z9The user selected the menu entry or hotkey, open the tip.T�break)�open_calltip)r r r r r �force_open_calltip_event) s z Calltip.force_open_calltip_eventc C s | j 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. FN)r )r r r r r �try_open_calltip_event. s zCalltip.try_open_calltip_eventc C s | j r| j jr| jd� d S )NF)r Z tipwindowr )r r r r r �refresh_calltip_event5 s zCalltip.refresh_calltip_eventc C s� | j � t| jd�}|jd�}|s&d S |j|d � |j� }|sDd S | r\|jd�dkr\d S | j|�}|snd S | j� | _ | j 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|jdd|fi �S tt|��S dS )aD Return 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�execZget_the_calltip) r ZflistZpyshellZinterp�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 s>