관리-도구
편집 파일: query.cpython-37.pyc
B � f2: � @ s d Z ddlZddlZddlZddlmZmZ ddlmZm Z m Z mZmZm Z ddlmZmZmZmZmZ ddlmZ ddlmZ G dd � d e�ZG d d� de�ZG dd � d e�ZG dd� de�ZG dd� de�ZG dd� de�Zedk�rddlmZ edddd� ddl m!Z! e!eee� dS )a| Dialogs that query users and verify the answer before accepting. Query is the generic base class for a popup dialog. The user must either enter a valid answer or close the dialog. Entries are validated when <Return> is entered or [Ok] is clicked. Entries are ignored when [Cancel] or [X] are clicked. The 'return value' is .result set to either a valid answer or None. Subclass SectionName gets a name for a new config file section. Configdialog uses it for new highlight theme and keybinding set names. Subclass ModuleName gets a name for File => Open Module. Subclass HelpSource gets menu item and path for additions to Help menu. � N)� executable�platform)�Toplevel� StringVar� BooleanVar�W�E�S)�Frame�Button�Entry�Label�Checkbutton)� filedialog)�Fontc sl e Zd ZdZdi ddd�dd�Zddd �Zd d� Zdd d�Zdd� Zddd�Z ddd�Z � fdd�Z� ZS )�QueryzoBase class for getting verified answer from a user. For this base class, accept any non-blank string. � F)�text0� used_names�_htest�_utestc C sX || _ || _|| _|| _t�| |� | �� | �|� | �|� | � � | j �dd�}|dkr�y| j �dd| jdd� W n Y nX | � d| j� | � d | j� | �d | j� | � d| j� | � d| j� | �� | �� | �d |�� |�� d | �� d |�� |�s$|�� d | �� d nd f � | jddd� |�sT| �� | �� dS )a� Create modal popup, return when destroyed. Additional subclass init must be done before this unless _utest=True is passed to suppress wait_window(). title - string, title of popup dialog message - string, informational message to display text0 - initial value for entry used_names - names already in use _htest - bool, change box location when running htest _utest - bool, leave window hidden and not modal �tk�windowingsystemZaquaz!::tk::unsupported::MacWindowStyleZstyleZ moveableModalr z<Command-.>z<Key-Escape>ZWM_DELETE_WINDOWz<Key-Return>z <KP_Enter>z+%d+%d� � F)Zheight�widthN)�parent�messager r r �__init__Zwithdraw�titleZ transientZgrab_setr ZcallZ_wZbind�cancelZprotocol�ok�create_widgetsZupdate_idletasksZgeometryZwinfo_rootxZwinfo_widthZwinfo_reqwidthZwinfo_rootyZwinfo_heightZwinfo_reqheightZ resizableZ deiconifyZwait_window) �selfr r r r r r r r � r$ �2/opt/alt/python37/lib64/python3.7/idlelib/query.pyr % sB *zQuery.__init__�OKc C s6 t | dd� | _}|jdddd� |jddd� t|dd | jd �}t| | j�| _t |d| jd�| _ | j �� td d| j d�| _t|dd| jd�| _|jddddtd� | j jddddtt ddgd� | jjddddtt d� | �� t||d| jd�| _t|d| jd�| _| jjdddd� | jjdddd� dS )z�Create entry (rows, extras, buttons. Entry stuff on rows 0-2, spanning cols 0-2. Buttons on row 99, cols 1, 2. � )Zpaddingr Znews)�column�row�sticky� )Zweight�w�left)�anchor�justify�text� )r �textvariableZ TkCaptionFontT)�name�exists�root� �red)r0 � foreground�font� � )r( r) � columnspan�padxr* )r( r) r<