add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
f

��_�c@s�dZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZddl
mZmZmZddlmZddlmZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�Zddd�Zddd�Zedkr�ddlmZedddd�ddlmZee�dS)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|�dkst|�dkr"|��n|��t��||�dS)Ngg�?)Zfloat�gridZgrid_remove�super�set)�selfZloZhi��	__class__��)/usr/lib64/python3.10/idlelib/textview.pyrs
zAutoHideScrollbar.setcK�t|jj�d���dS)Nz does not support "pack"�rr�__name__�r�kwargsrrr�pack�zAutoHideScrollbar.packcKr)Nz does not support "place"rrrrr�placer zAutoHideScrollbar.place)r�
__module__�__qualname__�__doc__rrr!�
__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<|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)ZrowZcolumnZstickyi)ZweightF)Zorient�	takefocus�commandZyscrollcommandZxscrollcommandN)r�__init__r�textrrZgrid_rowconfigureZgrid_columnconfigurerrZyviewZyscrollrrr	rZxviewZxscrollr)rZmasterr(rr,rrrr+"s&
��zScrollableTextFrame.__init__)rr"r#r$r	r+r%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�)ZreliefZheightz1.0rZdisabled)r(ZhighlightthicknessZstate�CloseF�r,r*r)�topT�both��sideZexpandZfillZbottom)r4N)rr+�parentZbind�okr&rZ	textframer,ZinsertZ	configurerZ	focus_setr�	button_okr)rr5�contentsr(r,r7rrrr+Js	
�zViewFrame.__init__NcCs|j��dS�zDismiss text viewer dialog.N)r5�destroy�rZeventrrrr6dszViewFrame.ok)r.�N)rr"r#r$r+r6r%rrrrr-Hsr-cs8eZdZdZdefddd��fdd�Zd
dd	�Z�ZS)�
ViewWindowz%A simple text viewer dialog for IDLE.TF)�_htest�_utestcs�t��|�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.
        iZborderwidthi
idz	=750x500+z+r'ZWM_DELETE_WINDOWr/Fr0r1Tr2r3N)rr+Zwinfo_rootxZwinfo_rootyZgeometry�titler-Z	viewframeZprotocolr6rr7r�is_modalZ	transientZgrab_setZwait_window)rr5r@r8�modalr(r>r?ZxZyr7rrrr+ls$
�
zViewWindow.__init__NcCs|jr|��|��dSr9)rAZgrab_releaser:r;rrrr6�sz
ViewWindow.okr<)rr"r#r$r
r+r6r%rrrrr=is
�#r=Tr.FcCst||||||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=)r5r@r8rBr(r?rrr�	view_text�srDc

Cs�z:t|d|d��}|��}Wd�n1s.0YWn\tybtdd|�d�|d�YnJty�}	ztdt|	�|d�WYd}	~	nd}	~	00t||||||d	�SdS)
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.
    Zr)�encodingNzFile Load ErrorzUnable to load file z .)r@Zmessager5zUnicode Decode ErrorrC)ZopenZreadZOSErrorrZUnicodeDecodeErrorZstrrD)
r5r@ZfilenamerErBr(r?Zfiler8Zerrrrr�	view_file�s"*
�
��rFZ__main__)�mainzidlelib.idle_test.test_textviewi)Z	verbosityZexit)�runN�Tr.FrI) r$Ztkinterrrrrrrrrr	r
rZtkinter.ttkrr
rZtkinter.messageboxrZidlelib.colorizerrrr&r-r=rDrFrZunittestrGZidlelib.idle_test.htestrHrrrrZ<module>s4)!-