ó fc@sRdZddlTddlZddd„ƒYZd„ZedkrNeƒndS( sDBasic regular expression demonstration facility (Perl style syntax).iÿÿÿÿ(t*NtReDemocBs;eZd„Zd„Zd„Zdd„Zdd„ZRS(c Cs||_t|jdtddƒ|_|jjdtdtƒt|jƒ|_|jjdtƒ|jj ƒ|j ƒt|jdddtƒ|_ |j jdtdtƒt|jdtddƒ|_ |j jdtƒ|j jdtƒt |ƒ|_|jjdtdtƒt|ƒ|_|jjdƒt|jdd d |jd dd |jƒ|_|jjdtƒt|jdd d |jd dd |jƒ|_|jjdtƒt|jddddƒ|_|jjdtddƒ|jjdddƒt|jdddtƒ|_|jjdtƒt|jƒ|_|jjdddtƒ|jjd|jƒ|jjd|jƒd|_!|jƒ|jj"ƒ}|jj"|d|d ƒ|jj"ƒ}|jj"|d|d ƒdS(Ntanchorttexts&Enter a Perl-style regular expression:tsidetfilltsEnter a string to search:tfirstsHighlight first matchtvariabletvaluetcommandsHighlight all matchestalltwidthi<theightitexpandithitt backgroundtyellowsGroups:s(#tmastertLabeltWt promptdisplaytpacktTOPtXtEntryt regexdisplayt focus_sett addoptionst statusdisplayt labeldisplaytFramet showframet StringVartshowvartsett Radiobuttont recompiletshowfirstradiotLEFTt showallradiotTextt stringdisplaytBOTHt tag_configuret grouplabeltListboxt grouplisttbindt reevaluatetNonetcompiledtbindtags(tselfRtbtags((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyt__init__ sZ           c Csðg|_g|_g|_xÎdD]Æ}t|jƒddkrst|jƒ}|jdtƒ|jj|ƒnt t |ƒ}t ƒ}t |d |d |d dd |d |j ƒ}|jdtƒ|jj|ƒ|jj|ƒq"WdS(Nt IGNORECASEtLOCALEt MULTILINEtDOTALLtVERBOSEiiRRRtoffvaluetonvalueR R(R8R9R:R;R<(tframestboxestvarstlenRRRRtappendtgetattrtretIntVart CheckbuttonR%R'(R5tnametframetvaltvartbox((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyRHs*         cCs4d}x!|jD]}||jƒB}qW|}|S(Ni(RAtget(R5tflagsRK((s,/usr/lib64/python2.7/Tools/scripts/redemo.pytgetflags_s cCs¡yNtj|jjƒ|jƒƒ|_|jd}|jjddd|ƒWnBtj k r’}d|_|jjddt |ƒddƒnX|j ƒdS(NRRRs re.error: %stred( REtcompileRRMROR3RRtconfigterrorR2tstrR1(R5teventtbgtmsg((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyR%fs    c CsUy|jjddtƒWntk r-nXy|jjddtƒWntk r[nX|jjdtƒ|js|dS|jjdddƒ|jjdddƒ|jjdtƒ}d}d}xJ|t |ƒkr|jj ||ƒ}|dkrPn|j ƒ\}}||kr4|d}d}nd}d |}d |} |jj ||| ƒ|dkrï|jj|ƒt|jƒƒ} | jd|jƒƒxDtt | ƒƒD]-} d | | | f} |jjt| ƒq»Wn|d}|jjƒd krÌPqÌqÌW|dkr>|jjd d ddƒn|jjd dƒdS(NRs1.0thit0iRRtorangeis1.0 + %d charss%2d: %rRRs (no match)R(R*t tag_removetENDtTclErrorR/tdeleteR3R,RMRBtsearchR2tspanttag_addtyview_pickplacetlisttgroupstinserttgrouptrangeR"RRR( R5RURtlasttnmatchestmRttagtpfirsttplastRctitg((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyR1ssT             N(t__name__t __module__R7RROR2R%R1(((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyRs  ?   cCs6tƒ}t|ƒ}|jd|jƒ|jƒdS(NtWM_DELETE_WINDOW(tTkRtprotocoltquittmainloop(troottdemo((s,/usr/lib64/python2.7/Tools/scripts/redemo.pytmain¥s  t__main__((t__doc__tTkinterRERRxRo(((s,/usr/lib64/python2.7/Tools/scripts/redemo.pyts   ž