Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.10/idlelib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.10/idlelib/__pycache__/config_key.cpython-310.pyc
o

�9j~;�@s
dZddlmZmZmZmZddlmZmZm	Z	m
Z
mZmZddlm
Z
ddlmZddlZddlZdZeejej�Zed�Zd	Zd
ZdZeeeeeeZdd
�ZGdd�de�ZGdd�de�Zedkr�ddl m!Z!e!dddd�ddl"m#Z#e#e$�dSdS)z6
Dialog for building Tkinter accelerator key bindings
�)�Toplevel�Listbox�	StringVar�TclError)�Frame�Button�Checkbutton�Entry�Label�	Scrollbar)�
messagebox)�
_setup_dialogN)�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 ArrowcCsidd�dd�dd�dd�d	d
�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd �d!d"�id#d$�d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�d3d4�d5d6�d7d8�d9d:�d;d<�d=d>�d?d@�dAdB�dCdD��dEdEi�}|�||�}dF|vr�|tjvr�|��}dG|��S)Hz3Translate from keycap symbol to the Tkinter keysym.r�space�~�
asciitilde�!�exclam�@�at�#�
numbersign�%�percent�^�asciicircum�&�	ampersand�*�asterisk�(�	parenleft�)�
parenright�_�
underscore�-�minus�+�plus�=�equal�{�	braceleft�}�
braceright�[�bracketleft�]�bracketright�|�bar�;�	semicolon�:�colon�,�comma�.�period�<�less�>�greater�/�slash�?�questionr"�Priorr#�Nextr$�Leftr%�Rightr&�Upr'�Downr�ShiftzKey-)�get�string�ascii_lowercase�upper)�key�	modifiers�mapping�rm�)/usr/lib/python3.10/idlelib/config_key.py�
translate_keys����������������������������	�	�
�
����
rocszeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Z�ZS)�GetKeysFramezKey Sequence Errorcs�t��|�d|d<d|d<||_||_||_d|_t|�|_|j�d�|�	�g|_
|jD]}t|�}|�d�|j
�|�q/d|_
|��dS)a
        parent - parent of this dialog
        action - the name of the virtual event these keys will be
                 mapped to
        current_key_sequences - a list of all key sequence lists
                 currently mapped to virtual events, for overlap checking
        ��borderwidth�sunken�relief�FN)�super�__init__�parent�action�current_key_sequences�resultr�
key_string�set�set_modifiers_for_platform�
modifier_varsrk�append�advanced�create_widgets)�selfrxryrz�modifier�variable��	__class__rmrnrw1s"


zGetKeysFrame.__init__cOstj|i|��dS�N)r�	showerror)r��args�kwargsrmrmrnr�LszGetKeysFrame.showerrorc	Cs�t|dd�|_|jjdddddd�t|jd|j�d�d	�}|jd
d�t|jd|jd
dd�}|jdddd�t|�|_|jjddddd�i|_d}t	|j
|j�D])\}}|j�
||�}t|j|j|||dd�}|jd|dd
d�||j|<|d7}qRt|jddd�}|jddddd
d�t|jdddd�|_|jjdgt�R�|j�d |j�|jjdddd!d"�t|jd#|jjd$�}	|jj|	jd%�|	jdddd!d"�t|jd&|jd'�|_|jjdddd(�t|d)d�|_|jjdddddd�t|jdd*|j�d+�d,d�}
|
jd
d�t|j|jd-�|_|jjdd.�t|�|_ |j jddddd�t|j dd/d�}|jdddd0�t||j!d1d2�|_"|j"jddd3ddd4�|�!�dS)5N�keyseq_basic)�namer�nsew�)�row�column�sticky�padx�padyzNew keys for 'z' :��text�w)�anchor�left�grooverq)�justify�textvariablertrr�x)�ipadx�ipady�fill�)r�r�r�r�ru)�commandr�r��onvalue�offvalue)r�r�r�r�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.))r�r��)r�r��
columnspanr�r���
�single)�width�height�
selectmode�endz<ButtonRelease-1>�ns)r�r��rowspanr��vertical)�orientr�)�yscrollcommandz
Clear Keys)r�r�)r�r�r��keyseq_advancedzEnter new binding(s) for 'z' :
z2(These bindings will not be checked for validity!))r�)r�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>.)r�r�r��<< Basic Key Binding Entry)r�r��ew)r�r��stickr�r�)#r�frame_keyseq_basic�gridr
ry�packr|�frame_controls_basic�modifier_checkbuttons�ziprkr�modifier_labelrfr�build_key_stringr�list_keys_final�insert�AVAILABLE_KEYS�bind�final_key_selectedr�yview�configr}r�
clear_key_seq�button_clear�frame_keyseq_advancedr	�
advanced_keys�frame_help_advanced�toggle_level�button_level)r��basic_title�
basic_keysr�r�r��label�check�
help_basic�scroll_keys_final�advanced_title�
help_advancedrmrmrnr�Ps����
�

��������
�
�zGetKeysFrame.create_widgetscCs.tjdkrgd�|_ngd�|_ddi|_dS)aVDetermine list of names of key modifiers for this platform.

        The names are used to build Tk bindings -- it doesn't matter if the
        keyboard has these keys; it matters if Tk understands them.  The
        order is also important: key binding equality depends on it, so
        config-keys.def must use the same ordering.
        �darwin)re�Control�Option�Command)r��Altrer��CtrlN)�sys�platformrkr��r�rmrmrnr~�s

z'GetKeysFrame.set_modifiers_for_platformcCs�|j�d��d�r(|��|jjdd�|j��|j��|j�	�d|_
dS|��|jjdd�|j��|j��d|_
dS)	z'Toggle between basic and advanced keys.r��Advancedr�r�TzAdvanced Key Binding Entry >>FN)
r��cget�
startswithr�r�r��liftr�r��	focus_setr�r�r�r�rmrmrnr��s






zGetKeysFrame.toggle_levelNcCs|��dS)z3Handler for clicking on key in basic settings list.N)r��r��eventrmrmrnr���zGetKeysFrame.final_key_selectedcCsN|��}}|j�d�}|rt||�}|�|�|j�dd�|��d��dS)z2Create formatted string of modifiers plus the key.r�rWr?rYN)�
get_modifiersr�rfror�r|r}�join)r��keylistrk�	final_keyrmrmrnr��s

zGetKeysFrame.build_key_stringcCsdd�|jD�}dd�|D�S)z9Return ordered list of modifiers that have been selected.cSsg|]}|���qSrm)rf)�.0r�rmrmrn�
<listcomp>��z.GetKeysFrame.get_modifiers.<locals>.<listcomp>cSsg|]}|r|�qSrmrm)r��modrmrmrnr��r�)r)r��mod_listrmrmrnr��szGetKeysFrame.get_modifierscCsB|j�dd�|j�dd�|jD]}|�d�q|j�d�dS)z#Clear modifiers and keys selection.rr��movetoz0.0ruN)r��select_clearr�rr}r|)r�r�rmrmrnr��s

zGetKeysFrame.clear_key_seqcCsRd|_|j����}|s|j|j|dd�dS|js|�|�r'|�|�r'||_dS)NruzNo key specified.��titlerx�message)	r{r|rf�stripr��keyerror_titler��keys_ok�bind_ok)r��keysrmrmrn�ok�s
�zGetKeysFrame.okcCs�|j�d�}|��}|j}dd�|jD�}|�d�s$|j||dd�dS|s6|ttvr6|j||dd�dS|d	gkrO|ttd
vrOd}|j|||d�dS||vr_d}|j|||d�dSd
S)z�Validity check on user's 'basic' keybinding selection.

        Doesn't check the string produced by the advanced dialog because
        'modifiers' isn't set.
        r�cSsg|]	}|D]}|�qqSrmrm)r�r�rjrmrmrnr��s
�
�z(GetKeysFrame.keys_ok.<locals>.<listcomp>rYzMissing the final Key)rxr�zNo modifier key(s) specified.r�re)rrzBThe shift modifier by itself may not be used with this key symbol.z'This key combination is already in use.TF)	r�rfr�r�rz�endswithr��
FUNCTION_KEYS�	MOVE_KEYS)r�r�r�rkr��
key_sequences�msgrmrmrnr��s6
���
�
���zGetKeysFrame.keys_okc
Csdz
|�|dd��}Wnty)}z|j|j|d|��d�WYd}~dSd}~ww|�||�dS)z:Return True if Tcl accepts the new keys else show message.cSsdSr�rmrmrmrmrn�<lambda>sz&GetKeysFrame.bind_ok.<locals>.<lambda>z2The entered key sequence is not accepted.

Error: r�NFT)r�rr�r��unbind)r�r��binding�errrmrmrnr�s����zGetKeysFrame.bind_okr�)�__name__�
__module__�__qualname__r�rwr�r�r~r�r�r�r�r�r�r�r��
__classcell__rmrmr�rnrp,sY
	rpcsReZdZddd��fdd�
Zedd��Zejdd��Zd
d	d
�Zd
dd�Z�Z	S)�
GetKeysWindowF)�_htest�_utestcsft��|�|��d|d<|jddd�|��|��|��d|��d}|��|s:|�	�d|�
�dnd}|�d|�d|���|�|�t
|||�|_}	|�d|j�t|�}
t|
d	d
|jd�|_t|
dd
|jd�|_|jjd
d
ddd�|jjd
dddd�|	jdddd�|
jddd�|�|�t|�|��|s�|��|��dSdS)a�
        parent - parent of this dialog
        title - string which is the title of the popup dialog
        action - string, the name of the virtual event these keys will be
                 mapped to
        current_key_sequences - list, a list of all key sequence lists
                 currently mapped to virtual events, for overlap checking
        _htest - bool, change box location when running htest
        _utest - bool, do not wait when running unittest
        r�rrF)r�r�rq�rA�WM_DELETE_WINDOW�OK�)r�r�r��Cancelr)r�r�r�r�r��topT�both)�side�expandr��bottomr�)rr�N)rvrw�withdraw�	resizable�update_idletasks�winfo_rootx�winfo_width�winfo_reqwidth�winfo_rooty�winfo_height�winfo_reqheight�geometryr�rp�frame�protocol�cancelrrr��	button_ok�
button_cancelr�r��	transientr
�grab_set�	deiconify�wait_window)r�rxr�ryrzrr	r��yr�
frame_buttonsr�rmrnrwsF���
��
�zGetKeysWindow.__init__cCs|jjSr��rr{r�rmrmrnr{JszGetKeysWindow.resultcCs||j_dSr�r))r��valuermrmrnr{Nr�NcCs|j��|��|��dSr�)rr��grab_release�destroyr�rmrmrnr�Rs
zGetKeysWindow.okcCsd|_|��|��dS)Nru)r{r+r,r�rmrmrnr WszGetKeysWindow.cancelr�)
rrrrw�propertyr{�setterr�r rrmrmr�rnrs�.


r�__main__)�mainz!idlelib.idle_test.test_config_keyrqF)�	verbosity�exit)�run)%�__doc__�tkinterrrrr�tkinter.ttkrrrr	r
rr�tkinter.simpledialogr
rgr�r��tuplerh�digits�
ALPHANUM_KEYS�PUNCTUATION_KEYS�WHITESPACE_KEYS�	EDIT_KEYSr�r�rorprr�unittestr0�idlelib.idle_test.htestr3�
GetKeysDialogrmrmrmrn�<module>s< 
���oC�

Youez - 2016 - github.com/yon3zu
LinuXploit