b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / idlelib /
Filename/usr/lib64/python2.6/idlelib/MultiCall.pyc
Size15.83 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed20-Jun-2019 19:45
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc"@sGdZddkZddkZddkZddkZddklZdZdZdZ dZ
dZ d Z d
Z
d Zd Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdTZdUZdVZ dWZ!dXZ"dYZ#ei$�o(dZd[d\d]fZ%eee"e#fZ&n%d^d_d`dafZ%ee ee!fZ&e'gZ(e)e*e%��D]$Z+e%e+D]Z,e(e,e+fquqg[(�Z-d"dbd#��YZ.e)de*e%�>�Z/gZ0e/D]&Z1e0d$i2d%�e3e%�D��qË[0Z4d&�Z5e5e/�Z6gZ7x_e/D]WZ1dZ8x;e)e*e%��D]'Z9de9>e1@oe8e&e9OZ8q;q;We7i:e8�qWd'dcd(��YZ;dddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzfZ<e;fde.fe*e<�dZ=e'gZ>e)e*e<��D]$Z+e<e+D]Z,e>e,e+fqq[>�Z?ei@dB�ZAei@dC�ZBdD�ZCdE�ZDhZEdF�ZFeGdGjo¶eiH�ZIeFeiJ�eI�ZKeKiL�dgdH�ZMeMdI�eMdJ�eMdK�eMdL�eMdM�eMdN�eMdO�eMdP�eMdQ�eMdR�eMdS�eIiN�ndS({s�
MultiCall - a class which inherits its methods from a Tkinter widget (Text, for
example), but enables multiple calls of functions per virtual event - all
matching events will be called, not only the most specific one. This is done
by wrapping the event functions - event_add, event_delete and event_info.
MultiCall recognizes only a subset of legal event sequences. Sequences which
are not recognized are treated by the original Tk handling mechanism. A
more-specific event will be called before a less-specific event.

The recognized sequences are complete one-event sequences (no emacs-style
Ctrl-X Ctrl-C, no shortcuts like <3>), for all types of events.
Key/Button Press/Release events can have modifiers.
The recognized modifiers are Shift, Control, Option and Command for Mac, and
Control, Alt, Shift, Meta/M for other platforms.

For all events which were handled by MultiCall, a new member is added to the
event instance passed to the binded functions - mc_type. This is one of the
event type constants defined in this module (such as MC_KEYPRESS).
For Key/Button events (which are handled by MultiCall and may receive
modifiers), another member is added - mc_state. This member gives the state
of the recognized modifiers, as a combination of the modifier constants
also defined in this module (for example, MC_SHIFT).
Using these members is absolutely portable.

The order by which events are called is defined by these rules:
1. A more-specific event will be called before a less-specific event.
2. A recently-binded event will be called before a previously-binded event,
unless this conflicts with the first rule.
Each function will be called at most once for each event.
iÿÿÿÿN(t
macosxSupportiiiiiiiiii i
i i i
iiiiiiiiitShifttControltOptiontCommandtAlttMetatMt
_SimpleBindercBs,eZd�Zd�Zd�Zd�ZRS(cCsJ||_dt|dd|_||_||_g|_d|_dS(Nt<it>(ttypet_typestsequencetwidgett
widgetinstt bindedfuncstNonet handlerid(tselfR RR((s)/usr/lib64/python2.6/idlelib/MultiCall.pyt__init__Fs     cCsX|ip:|i|id�}|ii|i|i|�|_n|ii|�dS(NcSsw||_h}xatt|�ddd�D]C}||}||jo&t||<||�}|o|Sq,q,WdS(Niiÿÿÿÿ(tmc_typetrangetlentTrue(teventtlRt wascalledtitfunctr((s)/usr/lib64/python2.6/idlelib/MultiCall.pythandlerPs 


 (RRR RtbindRR
tappend(RttripletRR((s)/usr/lib64/python2.6/idlelib/MultiCall.pyR Ns


cCsJ|ii|�|ip,|ii|i|i|i�d|_ndS(N(RtremoveRtunbindRR
RR(RR"R((s)/usr/lib64/python2.6/idlelib/MultiCall.pyR$^s
cCs1|io#|ii|i|i|i�ndS(N(RRR$RR
(R((s)/usr/lib64/python2.6/idlelib/MultiCall.pyt__del__ds
(t__name__t
__module__RR R$R%(((s)/usr/lib64/python2.6/idlelib/MultiCall.pyREs   tccs:x3|],\}}d|>t@o|ddVqqWdS(iit-N(ts(t.0Rtm((s)/usr/lib64/python2.6/idlelib/MultiCall.pys <genexpr>ns  csid�}g}xS|D]K�tt�fd�|D���}|id|dt�|i|�qW|S(s�For each item of states return a list containing all combinations of
that item with individual bits reset, sorted by the number of set bits.
cSs8d}x+|o#t|d�\}}||7}q W|S(snumber of bits set in n base 2ii(tdivmod(tntnbtrem((s)/usr/lib64/python2.6/idlelib/MultiCall.pytnbitsws c3sx|]}�|@VqWdS(N((R+tx(tstate(s)/usr/lib64/python2.6/idlelib/MultiCall.pys <genexpr>�s tkeytreverse(tlisttsettsortRR!(tstatesR1t statelistt substates((R3s)/usr/lib64/python2.6/idlelib/MultiCall.pytexpand_substatesss "t_ComplexBindercBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs"||||i|id�}|S(Nc Ssàtg|(||_||_h}d}x�|D]z}xett|�ddd�D]G} || }
|
|jo*t||
<|| |�}|oPq�qRqRW|oPq/q/Wg|(x|o|i��q·W|o|SdS(Niiÿÿÿÿ(RRtmc_stateRRRtpop( RtlistsRR>tishandlerrunningtdoafterhandlerRRRRR((s)/usr/lib64/python2.6/idlelib/MultiCall.pyR�s.
  



 (RARB(RR@RR>R((s)/usr/lib64/python2.6/idlelib/MultiCall.pyt__create_handler�s
c Cs||_t|d|_||_||_hg}tD]
}|gq:~d6|_g|_g|_ g|_
x�tD]�}g}t |D]}||id|q�~}|i ||t
|�} dt||id}
|ii|
|ii|i|
| �f�qyWdS(NiR R
(R R ttypenameRRt_statesRRt
handleridsRARBt_state_subsetst_ComplexBinder__create_handlert _state_codest _state_namesR!R ( RR RRt_[1]R*t_[2]RR@Rtseq((s)/usr/lib64/python2.6/idlelib/MultiCall.pyR´s   +   0c sB�ii�d�píg}tD]
}|gq"~�i�d<x¾tD]²}g}�ddfD])}t|D]}|�i||qsqe~}�i|�it|�} dt|�i �df}
�i
i |
�i i
�i|
| �f�qJWn���fd�} �ip | �n�ii | �dS(Nis <%s%s-%s>cs �i�d�di��S(ii(RR!((RR"R(s)/usr/lib64/python2.6/idlelib/MultiCall.pyt<lambda>×s(Rthas_keyRERRGRHR RIRJRDRFR!RR RRARB( RR"RRKR*RLtdetailRR@RRMtdoit((R"RRs)/usr/lib64/python2.6/idlelib/MultiCall.pyR Ës ,,

 cs>���fd�}�ip |�n�ii|�dS(Ncs �i�d�di��S(ii(RR#((RR"R(s)/usr/lib64/python2.6/idlelib/MultiCall.pyRNÞs(RARBR!(RR"RRQ((RR"Rs)/usr/lib64/python2.6/idlelib/MultiCall.pyR$Ýs
 cCs7x0|iD]%\}}|ii|i||�q
WdS(N(RFRR$R(RRMtid((s)/usr/lib64/python2.6/idlelib/MultiCall.pyR%äs
(R&R'RHRR R$R%(((s)/usr/lib64/python2.6/idlelib/MultiCall.pyR=�s
    tKeyPresstKeyt
KeyReleaset ButtonPresstButtont
ButtonReleasetActivatet CirculatetColormapt Configuret
DeactivatetDestroytEntertExposetFocusIntFocusOuttGravitytLeavetMaptMotiont
MouseWheeltPropertytReparenttUnmapt
Visibilitys^\w+$s^[1-5]$cCs�| p"|ddjp|ddjod Sti|dd!d�}d}x:|o2|dtjo!|dt|d>O}|d=qQW|o*|dtjot|d}|d=nd St|tjo|p|od Sd }n�|g}d
D]}|t|qü~jo
t}nt}|p
d }n:t |�djo"|i
|d�o|d}nd S|||fS( s-Get a string which should describe an event sequence. If it is
successfully parsed as one, return a tuple containing the state (as an int),
the event type (as an index of _types), and the detail - None if none, or a
string if there is one. If the parsing is unsuccessful, return None.
iR iÿÿÿÿR
iR)RSRUN(RSRU( Rtstringtsplitt_modifier_namest _type_namest_binder_classesRt
_keysym_ret
_button_reRtmatch(R
twordst modifiersR RPRKR*ttype_re((s)/usr/lib64/python2.6/idlelib/MultiCall.pyt_parse_sequenceýs2*  
,

'cCsd|do1dt|dt|ddd|ddSdt|dt|dddSdS(NiR iiR)R
(RJR (R"((s)/usr/lib64/python2.6/idlelib/MultiCall.pyt_triplet_to_sequence's 1cs@�tjo t�Sd�f�fd��Y}|t�<|S(s©Return a MultiCall class which inherits its methods from the
given widget class (for example, Tkinter.Text). This is used
instead of a templating mechanism.
t MultiCallcs�eZe�ei�pt��fd�Zddd�fd�Zd�fd�Z �fd�Z
�fd�Z d�fd�Z d�Z
RS(cs`�i|||�h|_g}ttt��D]}|t||�|�q3~|_dS(N(Rt_MultiCall__eventinfoRRR Rpt_MultiCall__binders(RtargstkwargsRKR(R(s)/usr/lib64/python2.6/idlelib/MultiCall.pyR:s c s.t|�tjot|�djoò|d djoá|ddjoÐ||ijo©|i|}|ddj o8x5|dD]%}|i|di||d�q�Wn||d<|ddj o4x1|dD]!}|i|di||�qÔWqq|gg|i|<n�i||||�S(Nis<<iþÿÿÿs>>ii(R tstrRRzRR{R$R (RR
RtaddteiR"(R(s)/usr/lib64/python2.6/idlelib/MultiCall.pyR Cs&"
 '
 'csÐt|�tjoªt|�djo�|d djo�|ddjou||ijoe|i|\}}|dj oAx)|D]!}|i|di||�qWd|i|d<q½n�i|||�S(Nis<<iþÿÿÿs>>ii(R R~RRzRR{R$(RR
tfuncidRttripletsR"(R(s)/usr/lib64/python2.6/idlelib/MultiCall.pyR$Ts&"
cs¸||ijodgg|i|<n|i|\}}xw|D]o}t|�}|djo�i|||�qA|dj o|i|di||�n|i|�qAWdS(Ni(RzRRwt event_addR{R R!(Rtvirtualt sequencesRR�RMR"(R(s)/usr/lib64/python2.6/idlelib/MultiCall.pyR�_s 

cs¦||ijodS|i|\}}xw|D]o}t|�}|djo�i|||�q/|dj o|i|di||�n|i|�q/WdS(Ni(RzRwRt event_deleteR{R$R#(RR�R�RR�RMR"(R(s)/usr/lib64/python2.6/idlelib/MultiCall.pyR�os 

cs`|djp||ijo�i||�Sttt|i|d���i||�SdS(Ni(RRzt
event_infottupletmapRx(RR�(R(s)/usr/lib64/python2.6/idlelib/MultiCall.pyR�}s
 cSsbx[|iD]P}|i|\}}|o0x-|D]!}|i|di||�q1Wq
q
WdS(Ni(RzR{R$(RR�RR�R"((s)/usr/lib64/python2.6/idlelib/MultiCall.pyR%�s
N(R&R't
issubclasstTkintertMisctAssertionErrorRRR R$R�R�R�R%((R(s)/usr/lib64/python2.6/idlelib/MultiCall.pyRy7s  (t_multicall_dict(RRy((Rs)/usr/lib64/python2.6/idlelib/MultiCall.pytMultiCallCreator/s

 V
t__main__csS�fd�}tid|d|�tid|d��|dcd7<dS(Ncs �GHdS(N((R(RM(s)/usr/lib64/python2.6/idlelib/MultiCall.pyR�ss
<<handler%d>>ii(ttextR R�(RMR.R((RMs)/usr/lib64/python2.6/idlelib/MultiCall.pytbindseq�ss<Key>s
<Control-Key>s <Alt-Key-a>s<Control-Key-a>s<Alt-Control-Key-a>s<Key-b>s<Control-Button-1>s<Alt-Button-1>s
<FocusOut>s<Enter>s<Leave>iiii i@i�(R(R(R(R(R(R(R(RR(((sKeyPressRT(s
KeyRelease(RVRW(RX(RY(RZ(R[(R\(R](R^(R_(R`(Ra(Rb(Rc(Rd(Re(Rf(Rg(Rh(Ri(Rj(Rk(Ot__doc__tsysRltreR�tidlelibRt MC_KEYPRESSt
MC_KEYRELEASEtMC_BUTTONPRESStMC_BUTTONRELEASEt MC_ACTIVATEt MC_CIRCULATEt MC_COLORMAPt MC_CONFIGUREt
MC_DEACTIVATEt
MC_DESTROYtMC_ENTERt MC_EXPOSEt
MC_FOCUSINt MC_FOCUSOUTt
MC_GRAVITYtMC_LEAVEtMC_MAPt MC_MOTIONt
MC_MOUSEWHEELt MC_PROPERTYt MC_REPARENTtMC_UNMAPt
MC_VISIBILITYtMC_SHIFTt
MC_CONTROLtMC_ALTtMC_METAt MC_OPTIONt
MC_COMMANDtrunningAsOSXAppt
_modifierst_modifier_maskstdictRKRRtnumbertnameRnRRERLR*tjoint enumerateRJR<RGRIRRR!R=R Rpt_[3]RotcompileRqRrRwRxR�R�R&tTktroottTextR�tpackR�tmainloop(((s)/usr/lib64/python2.6/idlelib/MultiCall.pyt<module>s¶    

*
(3  [   "
* *  a