add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
3

�
�^�,c@s�dZddlTddlmZddlZGdd�d�ZGdd�de�ZGd	d
�d
e�ZGdd�de�Zd
d�ZGdd�de�Z	dd�Z
Gdd�de�Zdd�Ze
dkr�dd�Ze�dS)a&This modules handles dialog boxes.

It contains the following public symbols:

SimpleDialog -- A simple but flexible modal dialog box

Dialog -- a base class for dialogs

askinteger -- get an integer from the user

askfloat -- get a float from the user

askstring -- get a string from the user
�)Z*)�
messageboxNc@sLeZdZdgddddfdd�Zddd�Zd	d
�Zdd�Zd
d�Zdd�ZdS)�SimpleDialogZNcCs|rt||d�|_n
t|�|_|r:|jj|�|jj|�t|j|dd�|_|jjdtd�t|j�|_	|j	j�||_
||_||_|jj
d|j�x\tt|��D]L}||}	t|j	|	||fdd�d	�}
||kr�|
jtd
d�|
jttdd�q�W|jjd
|j�|j|�dS)N)�class_i�)�textZaspect�)�expand�fill�<Return>cSs
|j|�S�N)�done��self�num�r�,/usr/lib64/python3.6/tkinter/simpledialog.pyZ<lambda>6sz'SimpleDialog.__init__.<locals>.<lambda>�r�commandi)ZreliefZborderwidth)�siderr�WM_DELETE_WINDOW)�Toplevel�root�titleZiconnameZMessageZmessage�packZBOTH�FrameZframer
�cancel�default�bind�return_eventZrangeZlen�ButtonZconfigZRIDGE�LEFT�protocol�wm_delete_window�_set_transient)r�masterr�buttonsrrrrr
ZsZbrrr�__init__!s.

zSimpleDialog.__init__��?�333333�?c
Cs|j}|j�|j|�|j�|j�rJ|j�}|j�}|j�}|j�}n|j	�}|j
�}d}}|j�}	|j�}
|||	|}|||
|}||	|j	�kr�|j	�|	}n|dkr�d}||
|j
�kr�|j
�|
}n|dkr�d}|j
d||f�|j�dS)Nr�+%d+%d)r�withdraw�	transient�update_idletasksZwinfo_ismappedZwinfo_widthZwinfo_height�winfo_rootx�winfo_rootyZwinfo_screenwidthZwinfo_screenheightZwinfo_reqwidthZwinfo_reqheight�geometry�	deiconify)
rr"ZrelxZrelyZwidgetZm_widthZm_heightZm_xZm_yZw_widthZw_heightZxZyrrrr!=s4

zSimpleDialog._set_transientcCs.|jj�|jj�|jj�|jj�|jSr	)r�wait_visibility�grab_set�mainloop�destroyr
�rrrr�goZs




zSimpleDialog.gocC�&|jdkr|jj�n|j|j�dSr	)rr�bellr
�rZeventrrrra�
zSimpleDialog.return_eventcCr5r	)rrr6r
r3rrrr gr8zSimpleDialog.wm_delete_windowcCs||_|jj�dSr	)r
r�quitrrrrr
m�zSimpleDialog.done)r%r&)	�__name__�
__module__�__qualname__r$r!r4rr r
rrrrrs
rc@sVeZdZdZddd�Zdd�Zdd�Zd	d
�Zddd�Zdd
d�Z	dd�Z
dd�ZdS)�DialogzZClass to open dialogs.

    This class is intended as a base class for custom dialogs
    NcCs�tj||�|j�|j�r&|j|�|r4|j|�||_d|_t|�}|j	|�|_
|jddd�|j�|j
sv||_
|j
d|j�|jdk	r�|jd|j�d|j�df�|j�|j
j�|j�|j�|j|�dS)z�Initialize a dialog.

        Arguments:

            parent -- a parent window (the application window)

            title -- the dialog title
        N�)�padx�padyrr'i2)rr$r(Zwinfo_viewabler)r�parent�resultr�body�
initial_focusr�	buttonboxrrr-r+r,r.�	focus_setr/r0Zwait_window)rrBrrDrrrr$ys.




zDialog.__init__cCsd|_tj|�dS)zDestroy the windowN)rErr2r3rrrr2�szDialog.destroycC�dS)z�create dialog body.

        return widget that should have initial focus.
        This method should be overridden, and is called
        by the __init__ method.
        Nr)rr"rrrrD��zDialog.bodycCsvt|�}t|dd|jtd�}|jtddd�t|dd|jd�}|jtddd�|jd|j�|jd	|j�|j�d
S)z[add standard button box.

        override if you do not want the standard buttons
        ZOKi
)r�widthrrr?)rr@rA�Cancel)rrJrrz<Escape>N)rr�okZACTIVErrrr)rZbox�wrrrrF�szDialog.buttonboxc
CsB|j�s|jj�dS|j�|j�z|j�Wd|j�XdSr	)�validaterErGr(r*�applyrr7rrrrL�s
z	Dialog.okcCs |jdk	r|jj�|j�dSr	)rBrGr2r7rrrr�s

z
Dialog.cancelcCrH)z�validate the data

        This method is called automatically to validate the data before the
        dialog is destroyed. By default, it always validates OK.
        rrr3rrrrN�rIzDialog.validatecCrH)z�process the data

        This method is called automatically to process the data, *after*
        the dialog is destroyed. By default, it does nothing.
        Nrr3rrrrO�rIzDialog.applyr	r	r	)r;r<r=�__doc__r$r2rDrFrLrrNrOrrrrr>rs
2	


	r>c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�_QueryDialogNcCs4|s
tj}||_||_||_||_tj|||�dSr	)�tkinterZ
_default_root�prompt�minvalue�maxvalue�initialvaluer>r$)rrrSrVrTrUrBrrrr$sz_QueryDialog.__init__cCsd|_tj|�dSr	)�entryr>r2r3rrrr2r:z_QueryDialog.destroycCsrt||jtd�}|jddtd�t|dd�|_|jjddttd�|jdk	rl|jj	d|j�|jj
dt�|jS)N)rZjustifyrr?)Zrowr@ZstickyrW)Znamer)ZLabelrSrZgridZWZEntryrWZErVZinsertZselect_rangeZEND)rr"rMrrrrDs
z_QueryDialog.bodyc
Cs�y|j�}Wn*tk
r6tjd|jd|d�dSX|jdk	rf||jkrftjdd|j|d�dS|jdk	r�||jkr�tjdd|j|d�dS||_d	S)
Nz
Illegal valuez
Please try again)rBrz	Too smallz2The allowed minimum value is %s. Please try again.z	Too largez2The allowed maximum value is %s. Please try again.r)�	getresultZ
ValueErrorrZshowwarning�errormessagerTrUrC)rrCrrrrN#s0z_QueryDialog.validate)NNNN)r;r<r=r$r2rDrNrrrrrQ�s

rQc@�eZdZdZdd�ZdS)�
_QueryIntegerzNot an integer.cC�|j|jj��Sr	)ZgetintrW�getr3rrrrXG�z_QueryInteger.getresultN�r;r<r=rYrXrrrrr[E�r[cK�t||f|�}|jS)z�get an integer from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is an integer
    )r[rC�rrS�kw�drrr�
askintegerJ�rec@rZ)�_QueryFloatzNot a floating point value.cCr\r	)Z	getdoublerWr]r3rrrrXZr^z_QueryFloat.getresultNr_rrrrrgXr`rgcKra)z�get a float from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a float
    )rgrCrbrrr�askfloat]rfrhc@s$eZdZdd�Zdd�Zdd�ZdS)�_QueryStringcOs6d|kr|d|_|d=nd|_tj|f|�|�dS)N�show)�_QueryString__showrQr$)rZargsrcrrrr$ls

z_QueryString.__init__cCs(tj||�}|jdk	r$|j|jd�|S)N)rj)rQrDrkZ	configure)rr"rWrrrrDts
z_QueryString.bodycCs
|jj�Sr	)rWr]r3rrrrXzr^z_QueryString.getresultN)r;r<r=r$rDrXrrrrriksricKra)z�get a string from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a string
    )rirCrbrrr�	askstring}rfrlZ__main__cCsLt�}|fdd�}t|d|d�}|j�t|d|jd�}|j�|j�dS)NcSs^t|ddddgdddd�}t|j��ttd	d
dd��ttd	d
ddd��ttd	d��dS)Nz�This is a test dialog.  Would this have been an actual dialog, the buttons below would have been glowing in soft pink light.
Do you believe this?ZYesZNorKrizTest Dialog)rr#rrrZSpamz	Egg counti)rVzEgg weight
(in tons)rid)rTrUz	Egg labeli�)rZprintr4rerhrl)rrdrrr�doit�s

ztest.<locals>.doitZTestrZQuit)ZTkrrr9r1)rrmZtZqrrr�test�srn)rPrRrrrr>rQr[rergrhrirlr;rnrrrrZ<module>s SF