����JFIF���������
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
python37
/
lib64
/
python3.7
/
idlelib
/
__pycache__
/
Filename :
textview.cpython-37.pyc
back
Copy
B ����� f�������������������@���s����d�Z�ddlmZmZmZmZmZmZmZm Z m Z mZmZ�ddl mZmZmZ�ddlmZ�ddlmZ�G�dd��de�ZG�dd ��d e�ZG�d d��de�ZG�dd ��d e�Zddd�Zddd�Zedkr�ddlmZ�edddd��ddlmZ�ee��dS�)zSimple text browser for IDLE �����)�Toplevel�Text�TclError� HORIZONTAL�VERTICAL�NS�EW�NSEW�NONE�WORD�SUNKEN)�Frame� Scrollbar�Button)� showerror)�color_configc�������������������s0���e�Zd�ZdZ��fdd�Zdd��Zdd��Z���ZS�)�AutoHideScrollbarzpA scrollbar that is automatically hidden when not needed. Only the grid geometry manager is supported. c����������������s<���t�|�dkst�|�dk�r"|�����n|�����t���||��d�S�)Ng��������g�������?)�float�gridZgrid_remove�super�set)�self�lo�hi)� __class__���5/opt/alt/python37/lib64/python3.7/idlelib/textview.pyr������s���� zAutoHideScrollbar.setc�������������K���s���t�|�jj��d���d�S�)Nz does not support "pack")r���r����__name__)r����kwargsr���r���r����pack���s����zAutoHideScrollbar.packc�������������K���s���t�|�jj��d���d�S�)Nz does not support "place")r���r���r���)r���r���r���r���r����place���s����zAutoHideScrollbar.place)r���� __module__�__qualname__�__doc__r���r���r ���� __classcell__r���r���)r���r���r������s���r���c�������������������s$���e�Zd�ZdZef��fdd� Z���ZS�)�ScrollableTextFramezDisplay text with scrollbar(s).c����������������s����t���j|f|��t|�|d��}|�_|jddtd��|�jddd��|�jddd��t|�t d|j d�|�_|�jjddtd��|�jj |d<�|tkr�t|�td|jd�|�_|�jjddtd��|�jj |d <�nd |�_d S�)a���Create a frame for Textview. master - master widget for this frame wrap - type of text wrapping to use ('word', 'char' or 'none') All parameters except for 'wrap' are passed to Frame.__init__(). The Text widget is accessible via the 'text' attribute. Note: Changing the wrapping mode of the text widget after instantiation is not supported. )�wrapr���)�row�columnZsticky����)ZweightF)Zorient� takefocus�commandZyscrollcommandZxscrollcommandN)r����__init__r����textr���r ���Zgrid_rowconfigureZgrid_columnconfigurer���r���ZyviewZyscrollr���r���r ���r���ZxviewZxscrollr���)r���Zmasterr&���r���r-���)r���r���r���r,���"���s"���� zScrollableTextFrame.__init__)r���r!���r"���r#���r ���r,���r$���r���r���)r���r���r%������s���r%���c�������������������s,���e�Zd�ZdZd��fdd� Zd dd�Z���ZS�) � ViewFramez#Display TextFrame and Close button.�wordc����������������s����t����|��||�_|��d|�j��|��d|�j��t|�tdd�|�_|�jj�}|�_|� d|��|j |ddd��t|��|����t |�d |�jd d��|�_}|�jjdd dd��|jdd��dS�)a��Create a frame for viewing text with a "Close" button. parent - parent widget for this frame contents - text to display wrap - type of text wrapping to use ('word', 'char' or 'none') The Text widget is accessible via the 'text' attribute. z<Return>z<Escape>i���)ZreliefZheightz1.0r���Zdisabled)r&���Zhighlightthickness�state�CloseF)r-���r+���r*����topT�both)�side�expand�fillZbottom)r4���N)r���r,����parentZbind�okr%���r���Z textframer-����insertZ configurer���Z focus_setr���� button_okr���)r���r7����contentsr&���r-���r:���)r���r���r���r,���J���s���� zViewFrame.__init__Nc�������������C���s���|�j�����dS�)zDismiss text viewer dialog.N)r7����destroy)r����eventr���r���r���r8���d���s����zViewFrame.ok)r/���)N)r���r!���r"���r#���r,���r8���r$���r���r���)r���r���r.���H���s���r.���c�������������������s8���e�Zd�ZdZdefddd���fdd�Zd dd �Z���ZS�)� ViewWindowz%A simple text viewer dialog for IDLE.TF)�_htest�_utestc���������������s����t����|��d|�d<�|���d�}|���|s.dnd�} |��d|��d| �����|��|��t|�||d�|�_|��d|�j ��t |�d |�j d d��|�_} |�jjdd dd��||�_ |�j r�|��|��|�����|s�|�����dS�)a��Show the given text in a scrollable window with a 'close' button. If modal is left True, users cannot interact with other windows until the textview window is closed. parent - parent of this dialog title - string which is title of popup dialog contents - text to display in dialog wrap - type of text wrapping to use ('word', 'char' or 'none') _htest - bool; change box location when running htest. _utest - bool; don't wait_window when running unittest. ����Zborderwidth� ����d���z =750x500+�+)r&���ZWM_DELETE_WINDOWr1���F)r-���r+���r*���r2���Tr3���)r4���r5���r6���N)r���r,���Zwinfo_rootxZwinfo_rootyZgeometry�titler.���Z viewframeZprotocolr8���r���r:���r����is_modalZ transientZgrab_setZwait_window)r���r7���rE���r;����modalr&���r?���r@����x�yr:���)r���r���r���r,���l���s"���� zViewWindow.__init__Nc�������������C���s���|�j�r|�����|�����dS�)zDismiss text viewer dialog.N)rF���Zgrab_releaser<���)r���r=���r���r���r���r8�������s����z ViewWindow.ok)N)r���r!���r"���r#���r���r,���r8���r$���r���r���)r���r���r>���i���s���"r>���Tr/���Fc�������������C���s���t�|�|||||d�S�)a���Create text viewer for given text. parent - parent of this dialog title - string which is the title of popup dialog contents - text to display in this dialog wrap - type of text wrapping to use ('word', 'char' or 'none') modal - controls if users can interact with other windows while this dialog is displayed _utest - bool; controls wait_window on unittest )r&���r@���)r>���)r7���rE���r;���rG���r&���r@���r���r���r���� view_text����s����rJ���c������� ��� ���C���s����y&t�|d|d��}|���}W�dQ�R�X�W�n\�tk rP���tdd|�d�|�d��Y�nH�tk r��} �ztdt| �|�d��W�dd} ~ X�Y�nX�t|�|||||d �S�dS�) z�Create text viewer for text in filename. Return error message if file cannot be read. Otherwise calls view_text with contents of the file. �r)�encodingNzFile Load ErrorzUnable to load file z .)rE����messager7���zUnicode Decode Error)r&���r@���)�open�read�OSErrorr����UnicodeDecodeError�strrJ���) r7���rE����filenamerL���rG���r&���r@����filer;����errr���r���r���� view_file����s���� rV����__main__)�mainzidlelib.idle_test.test_textview����)� verbosity�exit)�runN)Tr/���F)Tr/���F) r#���Ztkinterr���r���r���r���r���r���r���r ���r ���r���r���Ztkinter.ttkr ���r���r���Ztkinter.messageboxr���Zidlelib.colorizerr���r���r%���r.���r>���rJ���rV���r���ZunittestrX���Zidlelib.idle_test.htestr\���r���r���r���r����<module>���s ���4)!- �