HEX
Server: Apache/2.4.65 (Unix) OpenSSL/1.1.1k
System: Linux vps109042.inmotionhosting.com 4.18.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User: cisa (1010)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //opt/imh/python3.13/lib/python3.13/idlelib/__pycache__/textview.cpython-313.pyc
�

��e����SrSSKJrJrJrJrJrJrJrJ	r	J
r
JrJr SSK
JrJrJr SSKJr SSKJr "SS\5r"SS	\5r"S
S\5r"SS
\5rSSjrSSjr\S:XaSSKJr \"SSSS9 SSKJr \"\5 gg)zSimple text browser for IDLE

�)�Toplevel�Text�TclError�
HORIZONTAL�VERTICAL�NS�EW�NSEW�NONE�WORD�SUNKEN)�Frame�	Scrollbar�Button)�	showerror)�color_configc�8^�\rSrSrSrU4SjrSrSrSrU=r	$)�AutoHideScrollbar�zhA scrollbar that is automatically hidden when not needed.

Only the grid geometry manager is supported.
c�>�[U5S:�d[U5S:aUR5 OUR5 [TU]X5 g)Ngg�?)�float�grid�grid_remove�super�set)�self�lo�hi�	__class__s   ��6/opt/imh/python3.13/lib/python3.13/idlelib/textview.pyr�AutoHideScrollbar.sets9�����9�s�?�e�B�i�#�o��I�I�K�����
���B��c�F�[URRS35e)Nz does not support "pack"�rr�__name__�r�kwargss  r �pack�AutoHideScrollbar.packs ���$�.�.�1�1�2�2J�K�L�Lr"c�F�[URRS35e)Nz does not support "place"r$r&s  r �place�AutoHideScrollbar.places ���$�.�.�1�1�2�2K�L�M�Mr"�)
r%�
__module__�__qualname__�__firstlineno__�__doc__rr(r+�__static_attributes__�
__classcell__�rs@r rrs�����M�N�Nr"rc�2^�\rSrSrSr\4U4SjjrSrU=r$)�ScrollableTextFrame�zDisplay text with scrollbar(s).c�0>�[TU]"U40UD6 [XS9=o@lUR	SS[
S9 UR
SSS9 URSSS9 [U[SURS9UlURR	SS[S9 URRUS'U[:XaX[U[SUR S9UlUR"R	SS[$S9 UR"RUS	'g
S
Ulg
)aYCreate 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�column�sticky�)�weightF)�orient�	takefocus�command�yscrollcommand�xscrollcommandN)r�__init__r�textrr
�grid_rowconfigure�grid_columnconfigurerr�yview�yscrollrrrr�xview�xscrollr	)r�masterr:r'rFrs     �r rE�ScrollableTextFrame.__init__"s���	����*�6�*���0�0��y��	�	�a��$�	�/����q���+��!�!�!�A�!�.�)��h�38�15���=���	
�����a��"��5�!%���!1�!1��
���4�<�,�T�*�7<�59�Z�Z�A�D�L�
�L�L���!�A�b��9�%)�\�\�%5�%5�D�!�"��D�Lr")rFrLrJ)	r%r.r/r0r1rrEr2r3r4s@r r6r6s���)�$(�# �# r"r6c�:^�\rSrSrSrSU4SjjrSSjrSrU=r$)�	ViewFrame�Hz#Display TextFrame and Close button.c�
>�[TU]U5 XlURSUR5 URSUR5 [U[SS9UlURR=o@lURSU5 URUSSS9 [U5 UR5 [US	URS
S9=UlnURRSS
SS9 URSS9 g)z�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�)�relief�heightz1.0r�disabled)r:�highlightthickness�state�CloseF�rFrBrA�topT�both��side�expand�fill�bottom)r]N)rrE�parent�bind�okr6r
�	textframerF�insert�	configurer�	focus_setr�	button_okr()rra�contentsr:rFrhrs      �r rE�ViewFrame.__init__Js����	���� ����	�	�*�d�g�g�&��	�	�*�d�g�g�&�,�T�&��M����>�>�.�.�.��y����E�8�$����D�Q�j��I��T������%+��7�D�G�G�u�&F�	F����������t�&��A����H��%r"c�8�URR5 g�zDismiss text viewer dialog.N)ra�destroy�r�events  r rc�ViewFrame.okds�������r")rhrarFrd)�word�N)	r%r.r/r0r1rErcr2r3r4s@r rPrPHs���)�&�4�r"rPc�H^�\rSrSrSrS\4SSS.U4SjjjrS	SjrSrU=r	$)
�
ViewWindow�iz%A simple text viewer dialog for IDLE.TF)�_htest�_utestc�D>�[TU]U5 SUS'UR5S-nUR5U(dSOS-n	UR	SUSU	35 URU5 [
XUS9UlURSUR5 [US	URS
S9=Uln
URRSS
SS9 X@l
UR(a:URU5 UR5 U(dUR!5 ggg)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.
��borderwidth�
�dz	=750x500+�+r9�WM_DELETE_WINDOWrXFrYrZTr[r\N)rrE�winfo_rootx�winfo_rooty�geometry�titlerP�	viewframe�protocolrcrrhr(�is_modal�	transient�grab_set�wait_window)rrar�ri�modalr:rvrw�x�yrhrs           �r rE�ViewWindow.__init__ls���	���� ���]����� �2�%����� �f�B�#�>���
�
�	�!��A�a�S�)�*��
�
�5��"�4��=����
�
�(�$�'�'�2�%+�D�w�48�G�G�u�&N�	N����������t�&��A��
��=�=��N�N�6�"��M�M�O��� � �"��r"c�f�UR(aUR5 UR5 grl)r��grab_releasermrns  r rc�
ViewWindow.ok�s���=�=��������r")rhr�r�rr)
r%r.r/r0r1rrErcr2r3r4s@r rtrtis*���+�6:��!#� ��!#�!#�F�r"rtFc	��[XX#XES9$)aoCreate 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:rw)rt)rar�rir�r:rws      r �	view_textr��s���f�X�4�O�Or"c	��[X#S9nUR5nSSS5 [XWXEUS9$!,(df   N=f![a [	SSU<S3US9 g[
an	[	S[
U	5US9 Sn	A	gSn	A	ff=f)	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.
)�encodingNr�zFile Load ErrorzUnable to load file z .)r��messagerazUnicode Decode Error)�open�readr��OSErrorr�UnicodeDecodeError�str)
rar��filenamer�r�r:rw�fileri�errs
          r �	view_filer��s���
(�
�(�
.�$��y�y�{�H�/����%� &�(�	(�/�
.���!��)�0���B�?��	!���!��.��c�(��	!���!�s/�	A�0�A�
>�A�B�	B�&A?�?B�__main__)�mainzidlelib.idle_test.test_textview�)�	verbosity�exit)�runN)TrqF) r1�tkinterrrrrrrr	r
rrr
�tkinter.ttkrrr�tkinter.messageboxr�idlelib.colorizerrrr6rPrtr�r�r%�unittestr��idlelib.idle_test.htestr�r-r"r �<module>r�s����;�;�;�;�0�0�(�*�N�	�N�&& �%�& �R���B*��*�ZP�CI���0�z����	*�a�e�D�+��
�O�r"