ok

Mini Shell

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

3

��2a�H�@s"ddlZddlZddlZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdTZdUZdVZdWZdXZdYZej dkr�d^Z!eeeefZ"ndcZ!eeeefZ"e#d d!�e$e%e!��D��Z&d"Z'Gd#d$�d$�Z(e$de%e!�>�Z)d%d!�e)D�Z*d&d'�Z+e+e)�Z,gZ-xNe)D]FZ.dZ/x0e$e%e!��D] Z0de0>e.@�r2e/e"e0OZ/�q2We-j1e/��qWGd(d)�d)�Z2d{Z3e2fde(fe%e3�dZ4e#dCd!�e$e%e3��D��Z5ej6dD�Z7ej6dE�Z8dFdG�Z9dHdI�Z:iZ;dJdK�Z<dLdM�Z=e>dNk�rddOl?m@Z@e@dPddQdR�ddSlAmBZBeBe=�dS)|�N���������	�
���
����������darwin�Shift�Control�Option�Command�Alt�Meta�McCs"g|]}t|D]}||f�qqS�)�
_modifiers)�.0�number�namer r �./opt/alt/python36/lib64/python3.6/multicall.py�
<listcomp>7sr&zapplication has been destroyedc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
_SimpleBindercCs8||_dt|dd|_||_||_g|_d|_dS)N�<r�>)�type�_types�sequence�widget�
widgetinst�bindedfuncs�	handlerid)�selfr*r-r.r r r%�__init__Jsz_SimpleBinder.__init__cCs>|js.|j|jfdd�}|jj|j|j|�|_|jj|�dS)NcSsT||_i}xDtt|�ddd�D],}||}||kr d||<||�}|r |Sq WdS)NrT���r3)�mc_type�range�len)�event�lr4�	wascalled�i�func�rr r r%�handlerTsz#_SimpleBinder.bind.<locals>.handler)r0r/r*r-�bindr.r,�append)r1�tripletr;r=r r r%r>Rs


z_SimpleBinder.bindcCs2|jj|�|js.|jj|j|j|j�d|_dS)N)r/�remover-�unbindr.r,r0)r1r@r;r r r%rBbsz_SimpleBinder.unbindcCsZ|jrVy|jj|j|j|j�Wn4tjk
rT}zt|jdkrD�WYdd}~XnXdS)Nr)	r0r-rBr.r,�tkinter�TclError�APPLICATION_GONE�args)r1�er r r%�__del__hsz_SimpleBinder.__del__N)�__name__�
__module__�__qualname__r2r>rBrHr r r r%r'Isr'cs(g|] �dj�fdd�tt�D���qS)�c3s*|]"\}}d|>�@r|ddVqdS)rr�-Nr )r"r:�m)�sr r%�	<genexpr>wsz<listcomp>.<genexpr>)�join�	enumerater!)r"r )rOr%r&wscsPdd�}g}x>|D]6�tt�fdd�|D���}|j|dd�|j|�qW|S)NcSs(d}x|r"t|d�\}}||7}qW|S)Nrr)�divmod)�n�nbZremr r r%�nbits�s
zexpand_substates.<locals>.nbitsc3s|]}�|@VqdS)Nr )r"�x)�stater r%rP�sz#expand_substates.<locals>.<genexpr>T)�key�reverse)�list�set�sortr?)ZstatesrVZ	statelistZ	substatesr )rXr%�expand_substates|s
r^c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_ComplexBindercCs||||j|jfdd�}|S)NcSs�dg|dd�<||_||_i}d}xZ|D]R}xFtt|�ddd�D].}	||	}
|
|krBd||
<||	|�}|rBPqBW|r(Pq(Wg|dd�<x|D]
}|�q�Wg|dd�<|r�|SdS)NTrr3r3)r4�mc_stater5r6)r7�listsr4r`�ishandlerrunning�doafterhandlerr9r<r8r:r;�fr r r%r=�s*


z0_ComplexBinder.__create_handler.<locals>.handler)rbrc)r1rar4r`r=r r r%Z__create_handler�s
z_ComplexBinder.__create_handlercs�|�_t|d�_|�_|�_ddd�tD�i�_g�_g�_g�_	xhtD]`}�fdd�t
|D�}�j||t|�}dt
|�jd}�jj|�jj�j||�f�qLWdS)NrcSsg|]}g�qSr r )r"rOr r r%r&�sz+_ComplexBinder.__init__.<locals>.<listcomp>csg|]}�jd|�qS)N)r/)r"r:)r1r r%r&�sr(r))r*r+�typenamer-r.�_statesr/�
handleridsrbrc�_state_subsets�_ComplexBinder__create_handler�_state_codes�_state_namesr?r>)r1r*r-r.rOrar=�seqr )r1r%r2�s
z_ComplexBinder.__init__cs��d�jkr�dd�tD��j�d<xrtD]j���fdd��ddfD�}�j|�jt��}dt��j�df}�jj|�j	j
�j||�f�q,W���fdd�}�js�|�n�j
j|�dS)NrcSsg|]}g�qSr r )r"rOr r r%r&�sz'_ComplexBinder.bind.<locals>.<listcomp>cs(g|] }t�D]}�j||�qqSr )rhr/)r"�detailr:)rOr1r r%r&�sz	<%s%s-%s>cs�j�d�dj��S)Nrr)r/r?r )r;r1r@r r%�<lambda>�sz%_ComplexBinder.bind.<locals>.<lambda>)r/rfrir*rjrkrergr?r-r>r.rbrc)r1r@r;rar=rl�doitr )r;rOr1r@r%r>�s


z_ComplexBinder.bindcs.���fdd�}�js|�n�jj|�dS)Ncs�j�d�dj��S)Nrr)r/rAr )r;r1r@r r%rn�sz'_ComplexBinder.unbind.<locals>.<lambda>)rbrcr?)r1r@r;ror )r;r1r@r%rB�sz_ComplexBinder.unbindcCsdx^|jD]T\}}y|jj|j||�Wqtjk
rZ}zt|jdkrJ�WYdd}~XqXqWdS)Nr)rgr-rBr.rCrDrErF)r1rl�idrGr r r%rH�sz_ComplexBinder.__del__N)rIrJrKrir2r>rBrHr r r r%r_�s
r_�KeyPress�Key�
KeyRelease�ButtonPress�Button�
ButtonRelease�Activate�	Circulate�Colormap�	Configure�
Deactivate�Destroy�Enter�Expose�FocusIn�FocusOut�Gravity�Leave�Map�Motion�
MouseWheel�Property�Reparent�Unmap�
VisibilitycCs"g|]}t|D]}||f�qqSr )r+)r"r#r$r r r%r&sz^\w+$z^[1-5]$cCs|s|ddks|d
dkr"dS|dd�jd�}d}x.|rf|dtkrf|dt|d>O}|d=q:W|r�|dtkr�t|d}|d=ndSt|tkr�|s�|r�dSd}nP|dd�dD�kr�t}nt}|s�d}n*t|�dko�|j|d��r�|d}ndS|||fS)
Nrr(rr)rMcSsg|]}t|�qSr )�_type_names)r"rOr r r%r&$sz#_parse_sequence.<locals>.<listcomp>rqrsr3r3)rqrs)	�split�_modifier_namesr��_binder_classesr'�
_keysym_re�
_button_rer6�match)r,Zwords�	modifiersr*rmZtype_rer r r%�_parse_sequences0

r�cCs`|dr8dt|dt|ddd|ddSdt|dt|dddSdS)Nrr(rrrMr))rkr+)r@r r r%�_triplet_to_sequence2s0r�cs0�tkrt�SG�fdd�d��}|t�<|S)NcsbeZdZ�fdd�Zd�fdd�	Zd�fdd�	Z�fdd	�Z�fd
d�Zd�fdd
�	Zdd�Z	dS)z#MultiCallCreator.<locals>.MultiCallcs:�j�f|�|�i�_��fdd�ttt��D��_dS)Ncsg|]}t||����qSr )r�)r"r:)r1r-r r%r&Ksz@MultiCallCreator.<locals>.MultiCall.__init__.<locals>.<listcomp>)r2�_MultiCall__eventinfor5r6r+�_MultiCall__binders)r1rF�kwargs)r-)r1r%r2Esz,MultiCallCreator.<locals>.MultiCall.__init__Ncs�t|�tkr�t|�dkr�|dd�dkr�|dd�dkr�||jkr�|j|}|ddk	r�x*|dD]}|j|dj||d�qbW||d<|ddk	r�x6|dD]}|j|dj||�q�Wn|gg|j|<�j||||�S)Nrz<<z>>rr���)r*�strr6r�r�rBr>)r1r,r;�addZeir@)r-r r%r>Ns 

z(MultiCallCreator.<locals>.MultiCall.bindcs�t|�tkr�t|�dkr�|dd�dkr�|dd�dkr�||jkr�|j|\}}|dk	r�x"|D]}|j|dj||�q^Wd|j|d<�j|||�S)Nrz<<z>>rrr�)r*r�r6r�r�rB)r1r,Zfuncidr;�tripletsr@)r-r r%rB`s 

z*MultiCallCreator.<locals>.MultiCall.unbindcs�||jkrdgg|j|<|j|\}}xT|D]L}t|�}|dkrP�j|||�q,|dk	rn|j|dj||�|j|�q,WdS)Nr)r�r��	event_addr�r>r?)r1�virtual�	sequencesr;r�rlr@)r-r r%r�ks

z-MultiCallCreator.<locals>.MultiCall.event_addcsv||jkrdS|j|\}}xT|D]L}t|�}|dkrF�j|||�q"|dk	rd|j|dj||�|j|�q"WdS)Nr)r�r��event_deleter�rBrA)r1r�r�r;r�rlr@)r-r r%r�|s

z0MultiCallCreator.<locals>.MultiCall.event_deletecsF|dks||jkr�j||�Sttt|j|d���j||�SdS)Nr)r��
event_info�tuple�mapr�)r1r�)r-r r%r��s
z.MultiCallCreator.<locals>.MultiCall.event_infocSs�x~|jD]t}|j|\}}|rx\|D]T}y|j|dj||�Wq$tjk
rv}zt|jdkrf�WYdd}~Xq$Xq$WqWdS)Nrr)r�r�rBrCrDrErF)r1r�r;r�r@rGr r r%rH�s
z+MultiCallCreator.<locals>.MultiCall.__del__)NNN)N)N)
rIrJrKr2r>rBr�r�r�rHr )r-r r%�	MultiCallBs	r�)�_multicall_dict)r-r�r )r-r%�MultiCallCreator:s
[r�cs�tj|�}|jd�tt|j�jd�dd��\}}|jd||df�ttj�|���j	�dgf�fdd�	}|d	�|d
�|d�|d�|d
�|d�|d�|d�|d�|d�|d�|d�dS)NzTest MultiCall�+rz+%d+%d�rcsH�fdd�}�jd|d|��jd|d��|dd7<dS)Ncst��dS)N)�print)r7)rlr r%r=�sz-_multi_call.<locals>.bindseq.<locals>.handlerz
<<handler%d>>rr)r>r�)rlrTr=)�text)rlr%�bindseq�sz_multi_call.<locals>.bindseqz<Key>z
<Control-Key>z<Alt-Key-a>z<Control-Key-a>z<Alt-Control-Key-a>z<Key-b>z<Control-Button-1>z
<Button-2>z<Alt-Button-1>z
<FocusOut>z<Enter>z<Leave>)
rCZToplevel�titler��intZgeometryr�r�ZText�pack)�parent�toprW�yr�r )r�r%�_multi_call�s&

 r��__main__)�mainzidlelib.idle_test.test_mainmenuF)�	verbosity�exit)�runrrr	� �@��r�r�r�r)r�r�r�r��r�r�r�rr)r�r�r�r��rqrr�rs�rtru�rv�rw�rx�ry�rz�r{�r|�r}�r~�r�r��r��r��r��r��r��r��r��r��r�)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)C�re�sysrCZMC_KEYPRESSZ
MC_KEYRELEASEZMC_BUTTONPRESSZMC_BUTTONRELEASEZMC_ACTIVATEZMC_CIRCULATEZMC_COLORMAPZMC_CONFIGUREZ
MC_DEACTIVATEZ
MC_DESTROYZMC_ENTERZ	MC_EXPOSEZ
MC_FOCUSINZMC_FOCUSOUTZ
MC_GRAVITYZMC_LEAVEZMC_MAPZ	MC_MOTIONZ
MC_MOUSEWHEELZMC_PROPERTYZMC_REPARENTZMC_UNMAPZ
MC_VISIBILITYZMC_SHIFTZ
MC_CONTROLZMC_ALTZMC_METAZ	MC_OPTIONZ
MC_COMMAND�platformr!Z_modifier_masks�dictr5r6r�rEr'rfrkr^rhrjrOr<r:r?r_r+r�r��compiler�r�r�r�r�r�r�rIZunittestr�Zidlelib.idle_test.htestr�r r r r%�<module>s�

-
`

'g


Zerion Mini Shell 1.0