%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/idlelib/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/idlelib/__pycache__/textview.cpython-38.pyc

U

qa@sdZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZddl
mZmZmZddlmZddlmZGdddeZGdd	d	eZGd
ddeZGdd
d
eZdddZdddZedkrddlmZeddddddlmZeedS)zSimple text browser for IDLE

)ToplevelTextTclError
HORIZONTALVERTICALNSEWNSEWNONEWORDSUNKEN)Frame	ScrollbarButton)	showerror)color_configcs0eZdZdZfddZddZddZZS)AutoHideScrollbarzpA scrollbar that is automatically hidden when not needed.

    Only the grid geometry manager is supported.
    cs<t|dkst|dkr"|n|t||dS)Ngg?)floatgridZgrid_removesuperset)selflohi	__class__,/usr/local/lib/python3.8/idlelib/textview.pyrs
zAutoHideScrollbar.setcKst|jjddS)Nz does not support "pack"rr__name__rkwargsrrrpackszAutoHideScrollbar.packcKst|jjddS)Nz does not support "place"rr rrrplaceszAutoHideScrollbar.place)r
__module____qualname____doc__rr"r#
__classcell__rrrrrsrcs$eZdZdZeffdd	ZZS)ScrollableTextFramezDisplay text with scrollbar(s).cstj|f|t||d}|_|jddtd|jddd|jdddt|t	d|j
d|_|jjddtd|jj
|d<|tkrt|td|jd|_|jjddtd|jj
|d	<nd
|_d
S)aCreate 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)rowcolumnZsticky)ZweightF)Zorient	takefocuscommandZyscrollcommandZxscrollcommandN)r__init__rtextrr	Zgrid_rowconfigureZgrid_columnconfigurerrZyviewZyscrollrrr
rZxviewZxscrollr)rZmasterr*r!r1rrrr0"s&
zScrollableTextFrame.__init__)rr$r%r&r
r0r'rrrrr(sr(cs,eZdZdZdfdd	Zd	ddZZS)
	ViewFramez#Display TextFrame and Close button.wordcst|||_|d|j|d|jt|tdd|_|jj}|_|	d||j
|dddt||t
|d	|jd
d|_}|jjdd
dd|jdddS)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)ZreliefZheightz1.0rdisabled)r*ZhighlightthicknessstateCloseFr1r/r.topTbothsideexpandfillZbottom)r;N)rr0parentbindokr(rZ	textframer1insertZ	configurerZ	focus_setr	button_okr")rr>contentsr*r1rBrrrr0Js$	zViewFrame.__init__NcCs|jdSzDismiss text viewer dialog.N)r>destroyreventrrrr@dszViewFrame.ok)r3)N)rr$r%r&r0r@r'rrrrr2Hsr2cs8eZdZdZdefdddfddZd
dd	ZZS)
ViewWindowz%A simple text viewer dialog for IDLE.TF)_htest_utestcst|d|d<|d}||s.dnd}	|d|d|	||t|||d|_|d|j	t
|d	|j	d
d|_}
|jjdd
dd||_
|j
r||||s|dS)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.
        Zborderwidth
dz	=750x500++r)ZWM_DELETE_WINDOWr6Fr7r8Tr9r:N)rr0Zwinfo_rootxZwinfo_rootyZgeometrytitler2Z	viewframeprotocolr@rrBr"is_modalZ	transientZgrab_setZwait_window)rr>rOrCmodalr*rIrJxyrBrrrr0ls&

zViewWindow.__init__NcCs|jr||dSrD)rQZgrab_releaserErFrrrr@sz
ViewWindow.ok)N)rr$r%r&rr0r@r'rrrrrHis#rHTr3FcCst||||||dS)aCreate 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*rJ)rH)r>rOrCrRr*rJrrr	view_textsrVc

Csz&t|d|d}|}W5QRXWn\tk
rPtdd|d|dYnHtk
r}	ztdt|	|dW5d}	~	XYnXt||||||d	SdS)
zCreate text viewer for text in filename.

    Return error message if file cannot be read.  Otherwise calls view_text
    with contents of the file.
    r)encodingzFile Load ErrorzUnable to load file z .)rOmessager>zUnicode Decode ErrorNrU)openreadOSErrorrUnicodeDecodeErrorstrrV)
r>rOfilenamerXrRr*rJfilerCerrrrr	view_files"

rb__main__)mainzidlelib.idle_test.test_textview)	verbosityexit)runN)Tr3F)Tr3F) r&tkinterrrrrrrrr	r
rrZtkinter.ttkr
rrZtkinter.messageboxrZidlelib.colorizerrrr(r2rHrVrbrZunittestrdZidlelib.idle_test.htestrhrrrr<module>s"4)!-



Zerion Mini Shell 1.0