Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.10/idlelib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.10/idlelib/__pycache__/textview.cpython-310.pyc
o

�9j��@s�dZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZddl
mZmZmZddlmZddlmZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�Zddd�Z		ddd�Zedkr{ddlmZedddd�ddlmZee�dSdS)zSimple text browser for IDLE

�)�Toplevel�Text�TclError�
HORIZONTAL�VERTICAL�NS�EW�NSEW�NONE�WORD�SUNKEN)�Frame�	Scrollbar�Button)�	showerror)�color_configcs0eZdZdZ�fdd�Zdd�Zdd�Z�ZS)�AutoHideScrollbarzpA scrollbar that is automatically hidden when not needed.

    Only the grid geometry manager is supported.
    cs<t|�dkst|�dkr|��n|��t��||�dS)Ngg�?)�float�grid�grid_remove�super�set)�self�lo�hi��	__class__��'/usr/lib/python3.10/idlelib/textview.pyrs
zAutoHideScrollbar.setcK�t|jj�d���)Nz does not support "pack"�rr�__name__�r�kwargsrrr�pack�zAutoHideScrollbar.packcKr)Nz does not support "place"r r"rrr�placer%zAutoHideScrollbar.place)r!�
__module__�__qualname__�__doc__rr$r&�
__classcell__rrrrrs
rcs$eZdZdZef�fdd�	Z�ZS)�ScrollableTextFramezDisplay text with scrollbar(s).cs�t�j|fi|��t||d�}|_|jddtd�|jddd�|jddd�t|t	d|j
d�|_|jjddtd�|jj
|d<|tkrat|td|jd�|_|jjddtd�|jj
|d	<d
Sd
|_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�column�sticky�)�weightF)�orient�	takefocus�command�yscrollcommand�xscrollcommandN)r�__init__r�textrr	�grid_rowconfigure�grid_columnconfigurerr�yview�yscrollrrr
r�xview�xscrollr)r�masterr-r#r9rrrr8"s&
��
zScrollableTextFrame.__init__)r!r'r(r)r
r8r*rrrrr+sr+cs,eZdZdZd�fdd�	Zd	dd�Z�ZS)
�	ViewFramez#Display TextFrame and Close button.�wordcs�t��|�||_|�d|j�|�d|j�t|tdd�|_|jj}|_|�	d|�|j
|ddd�t|�|��t
|d	|jd
d�|_}|jjdd
dd�|jdd�dS)aCreate 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�r9r5r4�topT�both��side�expand�fill�bottom)rMN)rr8�parent�bind�okr+r�	textframer9�insert�	configurer�	focus_setr�	button_okr$)rrQ�contentsr-r9rXrrrr8Js	
�zViewFrame.__init__NcCs|j��dS�zDismiss text viewer dialog.N)rQ�destroy�r�eventrrrrSdszViewFrame.ok)rB�N)r!r'r(r)r8rSr*rrrrrAHsrAcs8eZdZdZdefddd��fdd�Zd
dd	�Z�ZS)�
ViewWindowz%A simple text viewer dialog for IDLE.TF)�_htest�_utestcs�t��|�d|d<|��d}|��|sdnd}	|�d|�d|	���|�|�t|||d�|_|�d|j	�t
|d	|j	d
d�|_}
|jjdd
dd�||_
|j
re|�|�|��|sg|��dSdSdS)aShow 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+�+r,�WM_DELETE_WINDOWrHFrIrJTrKrLN)rr8�winfo_rootx�winfo_rooty�geometry�titlerA�	viewframe�protocolrSrrXr$�is_modal�	transient�grab_set�wait_window)rrQrkrY�modalr-r`ra�x�yrXrrrr8ls(
�
�zViewWindow.__init__NcCs|jr|��|��dSrZ)rn�grab_releaser[r\rrrrS�sz
ViewWindow.okr^)r!r'r(r)rr8rSr*rrrrr_is�#r_TrBFcCst||||||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-ra)r_)rQrkrYrrr-rarrr�	view_text�srwc

Cs�zt|d|d��}|��}Wd�n1swYWn0ty2tdd|�d�|d�YdStyM}	ztdt|	�|d�WYd}	~	dSd}	~	wwt||||||d	�S)
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 .)rk�messagerQzUnicode Decode Errorrv)�open�read�OSErrorr�UnicodeDecodeError�strrw)
rQrk�filenameryrrr-ra�filerY�errrrr�	view_file�s,
��
�
�����r��__main__)�mainzidlelib.idle_test.test_textview�)�	verbosity�exit)�runN)TrBF) r)�tkinterrrrrrrrr	r
rr�tkinter.ttkr
rr�tkinter.messageboxr�idlelib.colorizerrrr+rAr_rwr�r!�unittestr��idlelib.idle_test.htestr�rrrr�<module>s&4)!
-
��

Youez - 2016 - github.com/yon3zu
LinuXploit