Hacked By AnonymousFox

Current Path : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/config_key.cpython-36.opt-2.pyc

3

��2a`4�@szddlTddlmZddlmZddlZddlZGdd�de�Zedkrvddl	m
Z
e
d	d
dd�dd
lmZee�dS)�)�*)�	Scrollbar)�
messageboxNc@s�eZdZdZddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd#dd�Zd$dd�Zdd �Zd!d"�ZdS)%�
GetKeysDialogzKey Sequence ErrorF)�_htest�_utestc	CsNtj||�|j�|jdd�|jttd�|j|�|j|�|j�|j	d|j
�||_||_||_
d|_t|�|_|jjd�|j�g|_x,|jD]"}t|�}|jd�|jj|�q�Wd|_|j�|j�|j�|jd|j�|j�d|j�d|j�|�s(|j�d|j �dnd	f�|�sJ|j!�|j"�dS)
N�)�borderwidth)�height�widthZWM_DELETE_WINDOW�Fz+%d+%d��)#�Toplevel�__init__ZwithdrawZ	configureZ	resizableZFALSE�titleZ	transientZgrab_setZprotocol�Cancel�parent�action�currentKeySequences�resultZ	StringVar�	keyString�set�SetModifiersForPlatform�
modifier_vars�	modifiers�append�advanced�
CreateWidgets�LoadFinalKeyListZupdate_idletasksZgeometryZwinfo_rootxZwinfo_widthZwinfo_reqwidthZwinfo_rootyZwinfo_heightZwinfo_reqheightZ	deiconifyZwait_window)	�selfrrrrrr�modifier�variable�r#�//opt/alt/python36/lib64/python3.6/config_key.pyrsB




*zGetKeysDialog.__init__cOstj||�dS)N)r�	showerror)r �args�kwargsr#r#r$r%>szGetKeysDialog.showerrorc	Cst|dtd�}|jtttd�t|�}|jttd�t|dd|j	d�|_
|j
jddd	d	d
�t|dd|jd�|_
|j
jddd	d	d
�t|�|_t|�|_t|�|_t|�|_|jjddtd	d	d
�|jjddtd	d	d
�|jj�|jjddtd	d�|jjddtd	d�|jj�t||jdd�|_|jjddtd	d	d�t|jd|jdd�}|jtd�t|jt|jtdd�}|jd	d	td�i|_d}xft|j|j �D]T\}}|j!j"||�}t#|j|j$|||dd�}	|	jd|dtd�|	|j|<|d7}�q�Wt|jtd?d!�}
|
jddd"dtd#�t%|jd$d%t&d&�|_'|j'j(d'|j)�|j'jdd"d"t*d(�t+|jt,|j'j-d)�}|j'j.|j/d*�|jdd	d"t*d(�t|jd+|j0d,�|_1|j1jddd"d-�t|jtd.|jd/d0d!�}|jtd�t2|j|jd1�|_3|j3jtd2�t|jtdEd!�}
|
jddtd:�dS)FNr
)r	�relief)�side�expand�fill)r)r+�OK�)�textr�commandrr)�row�column�padx�padyr�)r0r1�stickyr2r3)r0r1r5r2zAdvanced Key Binding Entry >>)r/r.)r0r1Zstickr2r3zNew keys for  'z' :)r.)Zanchor)�justify�textvariabler(r	)ZipadxZipadyr+r)r/r.r"ZonvalueZoffvalue)r0r1r2r5z!Select the desired modifier keys
z"above, and the final key from the
zlist on the right.

z"Use upper case Symbols when using
z&the Shift modifier.  (Letters will be
zconverted automatically.))r6r.�)r0r1�
columnspanr2r5��
)rr
Z
selectmodez<ButtonRelease-1>)r0r1Zrowspanr5)Zorientr/)Zyscrollcommandz
Clear Keys)r.r/)r0r1r9zEnter new binding(s) for  'z' :
z2(These bindings will not be checked for validity!))r7)r+z4Key bindings are specified using Tkinter keysyms as
z�in these samples: <Control-f>, <Shift-F2>, <F12>,
<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.
Upper case is used when the Shift modifier is present!

z8'Emacs style' multi-keystroke bindings are specified as
z5follows: <Control-x><Control-y>, where the first key
z!is the 'do-nothing' keybinding.

z4Multiple separate bindings for one action should be
z,separated by a space, eg., <Alt-v> <Meta-v>.)r0r1r5zCSelect the desired modifier keys
above, and the final key from the
zWSelect the desired modifier keys
above, and the final key from the
list on the right.

zySelect the desired modifier keys
above, and the final key from the
list on the right.

Use upper case Symbols when using
z�Select the desired modifier keys
above, and the final key from the
list on the right.

Use upper case Symbols when using
the Shift modifier.  (Letters will be
z�Select the desired modifier keys
above, and the final key from the
list on the right.

Use upper case Symbols when using
the Shift modifier.  (Letters will be
converted automatically.)z�Key bindings are specified using Tkinter keysyms as
in these samples: <Control-f>, <Shift-F2>, <F12>,
<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.
Upper case is used when the Shift modifier is present!

aKey bindings are specified using Tkinter keysyms as
in these samples: <Control-f>, <Shift-F2>, <F12>,
<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.
Upper case is used when the Shift modifier is present!

'Emacs style' multi-keystroke bindings are specified as
a@Key bindings are specified using Tkinter keysyms as
in these samples: <Control-f>, <Shift-F2>, <F12>,
<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.
Upper case is used when the Shift modifier is present!

'Emacs style' multi-keystroke bindings are specified as
follows: <Control-x><Control-y>, where the first key
aaKey bindings are specified using Tkinter keysyms as
in these samples: <Control-f>, <Shift-F2>, <F12>,
<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.
Upper case is used when the Shift modifier is present!

'Emacs style' multi-keystroke bindings are specified as
follows: <Control-x><Control-y>, where the first key
is the 'do-nothing' keybinding.

a�Key bindings are specified using Tkinter keysyms as
in these samples: <Control-f>, <Shift-F2>, <F12>,
<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.
Upper case is used when the Shift modifier is present!

'Emacs style' multi-keystroke bindings are specified as
follows: <Control-x><Control-y>, where the first key
is the 'do-nothing' keybinding.

Multiple separate bindings for one action should be
a�Key bindings are specified using Tkinter keysyms as
in these samples: <Control-f>, <Shift-F2>, <F12>,
<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.
Upper case is used when the Shift modifier is present!

'Emacs style' multi-keystroke bindings are specified as
follows: <Control-x><Control-y>, where the first key
is the 'do-nothing' keybinding.

Multiple separate bindings for one action should be
separated by a space, eg., <Alt-v> <Meta-v>.)4ZFrameZSUNKEN�packZTOPZTRUEZBOTHZBOTTOM�XZButtonr,ZbuttonOKZgridrZbuttonCancel�frameKeySeqBasic�frameKeySeqAdvanced�frameControlsBasic�frameHelpAdvancedZNSEW�lift�ToggleLevel�buttonLevelZEWZLabelr�WZLEFTrZGROOVEZmodifier_checkbuttons�ziprr�modifier_label�getZCheckbutton�BuildKeyStringZListboxZSINGLE�
listKeysFinal�bind�FinalKeySelectedZNSrZVERTICAL�yview�configr�ClearKeySeqZbuttonClearZEntry�entryKeysAdvanced)r Z	frameMainZframeButtonsZlabelTitleBasicZlabelKeysBasicr1r!r"ZlabelZcheckZ
labelFnAdviceZscrollKeysFinalZlabelTitleAdvancedZlabelHelpAdvancedr#r#r$rBs�










zGetKeysDialog.CreateWidgetscCs4tjdkrddddg|_ndddg|_ddi|_dS)N�darwin�ShiftZControlZOptionZCommandZAltZCtrl)�sys�platformrrG)r r#r#r$r�s
z%GetKeysDialog.SetModifiersForPlatformcCs�|jjd�dd�dkrT|j�|jjdd�|jj�|jj�|jj�d|_	n0|j�|jjdd�|j
j�|jj�d|_	dS)	Nr.r-ZAdvancedz<< Basic Key Binding Entry)r.TzAdvanced Key Binding Entry >>F)rDZcgetrOrNr?rBrArPZ	focus_setrr>r@)r r#r#r$rC�s




zGetKeysDialog.ToggleLevelcCs|j�dS)N)rI)r �eventr#r#r$rL�szGetKeysDialog.FinalKeySelectedcCsP|j�}}|jjt�}|r2|j||�}|j|�|jjddj|�d�dS)N�<�-�>)	�GetModifiersrJrH�ANCHOR�TranslateKeyrrr�join)r ZkeyListr�finalKeyr#r#r$rI�s
zGetKeysDialog.BuildKeyStringcCsdd�|jD�}dd�|D�S)NcSsg|]}|j��qSr#)rH)�.0r"r#r#r$�
<listcomp>�sz.GetKeysDialog.GetModifiers.<locals>.<listcomp>cSsg|]}|r|�qSr#r#)r^�modr#r#r$r_�s)r)r ZmodListr#r#r$rY�szGetKeysDialog.GetModifierscCsF|jjdt�|jjtd�x|jD]}|jd�q$W|jjd�dS)Nrz0.0r)rJZselect_clear�ENDrMZMOVETOrrr)r r"r#r#r$rO�s
zGetKeysDialog.ClearKeySeqcCsnd|_ttjtj�|_td
�|_d|_d|_d|_	|j|j|j|j|j|j	}|j
jtf|��dS) N�F1�F2�F3�F4�F5�F6�F7�F8�F9�F10�F11�F12z~!@#%^&*()_-+={}[]|;:,.<>/?�Tab�Space�Return�	BackSpace�Delete�Insert�Home�End�Page Up�	Page Down�
Left Arrow�Right Arrow�Up Arrow�
Down Arrow)rbrcrdrerfrgrhrirjrkrlrm)rnrorp)rqrrrs)rtrurvrwrxryrzr{)
�functionKeys�tuple�string�ascii_lowercase�digitsZalphanumKeysZpunctuationKeysZwhitespaceKeysZeditKeys�moveKeysrJ�insertra)r �keysr#r#r$r�s
$zGetKeysDialog.LoadFinalKeyListc$Cs�ddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$�#}||kr\||}d%|krv|tjkrv|j�}d&|}|S)'NZspaceZ
asciitildeZexclamZatZ
numbersign�percentZasciicircumZ	ampersandZasteriskZ	parenleftZ
parenrightZ
underscoreZminusZplusZequalZ	braceleftZ
bracerightZbracketleftZbracketrightZbarZ	semicolonZcolonZcommaZperiodZlessZgreaterZslashZquestionZPriorZNextZLeftZRightZUpZDownrn)#ro�~�!�@�#�%�^�&r�(�)�_rW�+�=�{�}�[�]�|�;�:�,�.rVrX�/�?zPage Upz	Page Downz
Left ArrowzRight ArrowzUp Arrowz
Down ArrowrnrRzKey-)r~r�upper)r �keyrZ
translateDictr#r#r$r[�s 

zGetKeysDialog.TranslateKeyNcCs\|jj�j�}|s(|j|j|dd�dS|js8|j|�rH|j|�rH||_|j	�|j
�dS)NzNo key specified.)rr�message)rrH�stripr%�keyerror_titler�KeysOK�bind_okr�grab_release�destroy)r rUr�r#r#r$r,�s
zGetKeysDialog.OKcCsd|_|j�|j�dS)Nr)rr�r�)r rUr#r#r$r�szGetKeysDialog.CancelcCs�|jjt�}|j�}d}|j}dd�|jD�}|jd�sJ|j||dd�n~|rr||j|j	krr|j||dd�nV|d	gkr�||j|j	dkr�d}|j|||d�n"||kr�d
}|j|||d�nd}|S)NFcSsg|]}|D]}|�qqSr#r#)r^Zkeylistr�r#r#r$r_sz(GetKeysDialog.KeysOK.<locals>.<listcomp>rXzMissing the final Key)rr�zNo modifier key(s) specified.)rrr�rRrnrozBThe shift modifier by itself may not be used with this key symbol.z'This key combination is already in use.T)rnro)
rJrHrZrYr�r�endswithr%r|r�)r r�r]rZkeysOKrZ
key_sequences�msgr#r#r$r��s,



zGetKeysDialog.KeysOKcCsby|j|dd��}Wn8tk
rL}z|j|j|d|��d�dSd}~XnX|j||�dSdS)NcSsdS)Nr#r#r#r#r$�<lambda>sz'GetKeysDialog.bind_ok.<locals>.<lambda>z2The entered key sequence is not accepted.

Error: )rrr�FT)rKZTclErrorr%r�Zunbind)r r�Zbinding�errr#r#r$r�szGetKeysDialog.bind_ok)N)N)�__name__�
__module__�__qualname__r�rr%rrrCrLrIrYrOrr[r,rr�r�r#r#r#r$rs -O

!r�__main__)�mainz!idlelib.idle_test.test_config_keyr
F)�	verbosity�exit)�run)
ZtkinterZtkinter.ttkrrr~rSrrr�Zunittestr�Zidlelib.idle_test.htestr�r#r#r#r$�<module>s

Hacked By AnonymousFox1.0, Coded By AnonymousFox