add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
f

��_�c@s�dZddlmZmZmZmZddlmZdZdZ	dZ
dZdZd	Z
Gd
d�de�Zdd
�Zedkr�ddlmZedddd�ddlmZee�dS)zvA call-tip window class for Tkinter/IDLE.

After tooltip.py, which uses ideas gleaned from PySol.
Used by calltip.py.
�)�Label�LEFT�SOLID�TclError)�TooltipBasez<<calltipwindow-hide>>)z<Key-Escape>z
<FocusOut>z<<calltipwindow-checkhide>>)z<KeyRelease>z<ButtonRelease>idZcalltipwindowregion_rightcsveZdZdZ�fdd�Zdd�Z�fdd�Z�fdd	�Zd
d�Zdd
d�Z	dd�Z
�fdd�Zdd�Zdd�Z
�ZS)�
CalltipWindowz+A call-tip widget for tkinter text widgets.csDtt|��|�d|_|_d|_|_|_d|_|_	d|_
dS)z}Create a call-tip; shown by showtip().

        text_widget: a Text widget with code for which call-tips are desired
        N)�superr�__init__�label�text�	parenline�parencol�lastline�hideid�checkhideid�checkhide_after_id)�selfZtext_widget�Z	__class__��*/usr/lib64/python3.10/idlelib/calltip_w.pyrs
zCalltipWindow.__init__cCs�t|j�d��d�d�}||jkr2|j|jf}n|df}|j�d|�}|snt|j�d��}d|d<d|d<|dd|d|dfS)z$Choose the position of the call-tip.�insert�.rz%d.%d��i)�int�
anchor_widget�index�splitrrZbboxZlist)r�curlineZanchor_indexZboxrrr�get_position#s
zCalltipWindow.get_positioncsLt|j�d��d�d�}||jkr(dS||_|j�d�tt|���dS)z Reposition the window if needed.rrrN)	rrrrr
Zseerr�position_window)rrrrrr2s
zCalltipWindow.position_windowcs^||_|js|jsdS|j�t|�tt|j�|��d��\|_	|_
tt|��
�|��dS)a_Show the call-tip, bind events which will close it and reposition it.

        text: the text to display in the call-tip
        parenleft: index of the opening parenthesis in the text widget
        parenright: index of the closing parenthesis in the text widget,
                    or the end of the line if there is no closing parenthesis
        Nr)r
�	tipwindowrZmark_set�
MARK_RIGHT�maprrrrrrr�showtip�_bind_events)rr
Z	parenleftZ
parenrightrrrr#;s	�zCalltipWindow.showtipc
Cs2t|j|jtddtd|jdd�|_|j��dS)zCreate the call-tip widget.z#ffffd0Zblackr�font)r
ZjustifyZ
backgroundZ
foregroundZreliefZborderwidthr%N)rr r
rrrr	�pack�rrrr�showcontentsPs�zCalltipWindow.showcontentsNcCs�|js
dStt|j�d��d��\}}||jksT||jkrD||jksT|j�ddt	�r`|�
�dS|��|jdur�|j�
|j�|j�t|j�|_dS)z4Handle CHECK_HIDE_EVENT: call hidetip or reschedule.Nrrz>�break)r r"rrrrrrZcomparer!�hidetiprrZafter_cancel�after�CHECKHIDE_TIME�checkhide_event)r�eventrZcurcolrrrr-Xs$
���
�zCalltipWindow.checkhide_eventcCs|js
dS|��dS)z%Handle HIDE_EVENT by calling hidetip.Nr))r r*)rr.rrr�
hide_eventsszCalltipWindow.hide_eventc	s�|js
dSz|j��Wnty*Yn0d|_d|_|_|_z|j�t	�WntyfYn0z|�
�Wnttfy�Yn0tt
|���dS)zHide the call-tip.N)r r	Zdestroyrrrr
rZ
mark_unsetr!�_unbind_eventsZ
ValueErrorrrr*r'rrrr*{s"zCalltipWindow.hidetipcCsh|j�t|j�|_tD]}|j�t|�q|j�t|j�|j�t	|j
�|_tD]}|j�t	|�qPdS)zBind event handlers.N)
r�bind�CHECKHIDE_EVENTr-r�CHECKHIDE_SEQUENCES�	event_addr+r,�
HIDE_EVENTr/r�HIDE_SEQUENCES�rZseqrrrr$�s��zCalltipWindow._bind_eventscCs`tD]}|j�t|�q|j�t|j�d|_tD]}|j�t|�q2|j�t|j�d|_dS)zUnbind event handlers.N)	r3rZevent_deleter2Zunbindrr6r5rr7rrrr0�szCalltipWindow._unbind_events�N)�__name__Z
__module__Z__qualname__�__doc__rrrr#r(r-r/r*r$r0Z
__classcell__rrrrrs
	
rcs�ddlm}m}m}m}||�}|�d�tt|���	d�dd��\}}|�d|d|df�||�}|j
||dd	�|�d
d�|��t
|���fdd
�}	�fdd�}
|�dd�|�dd�|�d|	�|�d|
�|��dS)Nr)�Toplevel�Textr�BOTHzTest call-tipsz+rz
250x100+%d+%di�i�)ZsideZfillZexpandrzstring.splitcs��ddd�dS)Nz(s='Hello world')rZend)r#�r.�Zcalltiprr�calltip_show��z%_calltip_window.<locals>.calltip_showcs���dSr8)r*r>r?rr�calltip_hide�rAz%_calltip_window.<locals>.calltip_hidez<<calltip-show>>z(z<<calltip-hide>>z))�tkinterr;r<rr=Ztitler"rZgeometryrr&rZupdaterr4r1Z	focus_set)Zparentr;r<rr=ZtopZxZyr
r@rBrr?r�_calltip_window�s"
 rDZ__main__)�mainz idlelib.idle_test.test_calltip_wrF)Z	verbosityZexit)�runN)r:rCrrrrZidlelib.tooltiprr5r6r2r3r,r!rrDr9ZunittestrEZidlelib.idle_test.htestrFrrrrZ<module>s