B €/g^k-c@sdGdd„dƒZGdd„dƒZGdd„dƒZGdd„dƒZdd lmZGd d „d ƒZGd d „d ƒZdS)c@óeZdZdd„ZdS)ÚEventcKs|j |¡dS©N)Z__dict__Zupdate)ÚselfÚkwds©rú1/usr/lib64/python3.7/idlelib/idle_test/mock_tk.pyÚ__init__ózEvent.__init__N)Ú__name__Ú __module__Ú __qualname__rrrrrrsrc@s&eZdZddd„Zdd„Zdd„ZdS) ÚVarNcCs||_||_||_dSr)ÚmasterÚvalueÚname)rr rrrrrrsz Var.__init__cCó ||_dSr©r)rrrrrÚsetózVar.setcCs|jSrr©rrrrÚget!rzVar.get©NNN)r r r rrrrrrrr s r c@seZdZddd„Zdd„ZdS)Ú Mbox_funcNcCrr)Úresult)rrrrrr+rzMbox_func.__init__cOs||_||_||_||_|jSr)ÚtitleÚmessageÚargsrr)rrrrrrrrÚ__call__-s zMbox_func.__call__r)r r r rrrrrrr$s rc@s<eZdZeƒZeƒZeƒZeƒZeƒZeƒZ eƒZ eƒZ dS)ÚMboxN) r r r rZ askokcancelZ askquestionZaskretrycancelZaskyesnoZaskyesnocancelZ showerrorZshowinfoZ showwarningrrrrr5sré)ÚTclErrorc@s”eZdZdifdd„Zdd„Zd!dd„Zd d „Zd d „Zd"d d„Zd#dd„Z dd„Z dd„Z dd„Z d$dd„Z dd„Zdd„Zdd„Zd%dd „ZdS)&ÚTextNcKsddg|_dS)NÚÚ )Údata)rr ZcnfZkwrrrrgsz Text.__init__cCsd|j|ddS)Nz%s.%sé)Úendflag)Ú_decode©rÚindexrrrr(orz Text.indexrcCst|ttfƒrt|ƒ}y | ¡}Wn"tk rDtd|ƒd‚YnXt|jƒd}|dkrr|t|j|ƒdfS|dkr„|  |¡S|  d¡\}}t |ƒ}|dkr¦dS||kr¸|  |¡St|j|ƒd}|  d¡sÜ|dkrä||fSt |ƒ}|dkrúd}n||kr|}||fS) Nzbad text index "%s"r$ÚinsertZendZ.)r$rz lineendr) Z isinstanceZfloatZbytesZstrZlowerZAttributeErrorrÚlenr#Ú_endexZsplitZintZendswith)rr(r%ZlastlineÚlineÚcharZ linelengthrrrr&ss4    z Text._decodecCs<t|jƒ}|dkr|dfS|d8}|t|j|ƒ|fSdS)Nr$r)r*r#)rr%Znrrrr+¦s  z Text._endexcCs²|sdS| d¡}|dddkr,| d¡| |d¡\}}|j|d|…}|j||d…}||d|j|<|dd…|j|d|d…<|j|t|ƒd|7<dS)NTéÿÿÿÿr"r!rr$)Z splitlinesÚappendr&r#r*)rr(Zcharsr,r-ZbeforeZafterrrrr)µs  z Text.insertc Cs°| |¡\}}|dkr&||d}}n| |¡\}}||krN|j|||…S|j||d…g}x&t|d|ƒD]}| |j|¡qrW| |j|d|…¡d |¡SdS)Nr$r!)r&r#Úranger/Zjoin) rÚindex1Úindex2Ú startlineÚ startcharÚendlineÚendcharZlinesÚirrrrÅszText.getcCs| |d¡\}}|dkrf|t|j|ƒdkr>||d}}qv|t|jƒdkr`|dd}}qvdSn| |d¡\}}||kr²||kr²|j|d|…|j||d…|j|<n^||kr|j|d|…|j||d…|j|<|d7}x t||dƒD]}|j|=qþWdS)Nr.r$r)r&r*r#r0)rr1r2r3r4r5r6r7rrrÚdeleteØs" z Text.deletecCsÜ| |¡\}}| |¡\}}|dkr<||kp:||ko:||kS|dkr\||kpZ||koZ||kS|dkr|||kpz||koz||kS|dkrœ||kpš||koš||kS|dkr´||ko²||kS|dkrÌ||kpÊ||kStd|ƒ‚dS)Nzz>=z==z!=z=bad comparison operator "%s": must be <, <=, ==, >=, >, or !=)r&r)rr1Zopr2Zline1Zchar1Zline2Zchar2rrrÚcompare÷s z Text.comparecCódSrr)rrr(rrrÚmark_set rz Text.mark_setcGr:rr)rZ markNamesrrrÚ mark_unsetrzText.mark_unsetcCr:rr)rZtagNamer1r2rrrÚ tag_removerzText.tag_removecCr:rr©rZxZyrrrÚ scan_dragtorzText.scan_dragtocCr:rrr>rrrÚ scan_markrzText.scan_markcCr:rrr'rrrÚsee!rzText.seecCr:rr)ZsequenceZfuncZaddrrrÚbind(rz Text.bind)rrrrr)r r r rr(r&r+r)rr8r9r;r<r=r?r@rArBrrrrr Zs  3   r c@r)ÚEntrycCr:rrrrrrÚ focus_set.rzEntry.focus_setN)r r r rDrrrrrC,srCN)rr rrZ_tkinterrr rCrrrrZs # S