관리-도구
편집 파일: autocomplete.cpython-36.pyc
3 � fl$ � @ s� d Z ddlZddlZddlZedd�\ZZddlmZ ddl m Z ddlmZ ddl Z ejej d ZejZejr|eej7 ZG d d � d �Zej� edkr�ddlmZ ed dd� dS )z�Complete either attribute names or file names. Either on demand or after a user-selected delay after a key character, pop up a list of candidates. � N� � )�autocomplete_w)�idleConf)�HyperParser�_c @ sv e Zd Zddd�Zedd� �Zdd� Zddd �Zd d� Zdd � Z dd� Z dd� Zdd� Zddd�Z dd� Zdd� ZdS )�AutoCompleteNc C s, || _ |d k r(|j| _d | _d | _d | _d S )N)�editwin�text�autocompletewindow�_delayed_completion_id�_delayed_completion_index)�selfr � r �9/opt/alt/python36/lib64/python3.6/idlelib/autocomplete.py�__init__ s zAutoComplete.__init__c C s t jdddddd�| _d S )N� extensionsr � popupwait�intr )�type�default)r Z GetOptionr )�clsr r r �reload) s zAutoComplete.reloadc C s t j| j�S )N)r ZAutoCompleteWindowr )r r r r �_make_autocomplete_window. s z&AutoComplete._make_autocomplete_windowc C s | j r| j j� d | _ d S )N)r Zhide_window)r �eventr r r �_remove_autocomplete_window1 s z(AutoComplete._remove_autocomplete_windowc C s | j ddd� dS )zqHappens when the user really wants to open a completion list, even if a function call is needed. TF�break)�open_completions)r r r r r �force_open_completions_event6 s z)AutoComplete.force_open_completions_eventc C sB | j jd�}|dkr&| jdddt� n|tkr>| jdddt� dS )z�Happens when it would be nice to open a completion list, but not really necessary, for example after a dot, so function calls won't be made. z insert-1c�.FN)r �get�_open_completions_later�COMPLETE_ATTRIBUTES�SEPS�COMPLETE_FILES)r r Zlastcharr r r �try_open_completions_event= s z'AutoComplete.try_open_completions_eventc C sd t |d�r|js$| jjdd�j� r(dS | jrF| jj� rF| jj� dS | jddd�}|r\dS dS dS )z�Happens when the user wants to complete his word, and if necessary, open a completion list after that (if there is more than one completion) �mc_statezinsert linestart�insertNr FT) �hasattrr&