Ñò
¦G<Hc        
   @   sé   d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Td  d k l Z d  d k l Z e Z	 d „  Z
 d „  Z e i e ƒ  e i ƒ Z e i d e i ƒ Z e i d ƒ Z d	 e f d
 „  ƒ  YZ d „  Z e d j o e ƒ  n d S(   iÿÿÿÿN(   t   *(   t	   Delegator(   t   idleConfc         C   s   d |  d i  | ƒ d S(   s9   Return a named group pattern matching list of alternates.s   (?P<%s>t   |t   )(   t   join(   t   namet
   alternates(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyt   any   s    c          C   sç   d t  d t i ƒ d }  g  } t t ƒ D]' } | i d ƒ p | t | ƒ q+ q+ ~ } d t  d | ƒ d } t  d d g ƒ } d } d	 } d
 } d }	 t  d | |	 | | g ƒ }
 |  d | d | d |
 d t  d d g ƒ S(   Ns   \bt   KEYWORDt   _s   ([^.'\"\\#]\b|^)t   BUILTINt   COMMENTs   #[^\n]*s&   (\b[rRuU])?'[^'\\\n]*(\\.[^'\\\n]*)*'?s&   (\b[rRuU])?"[^"\\\n]*(\\.[^"\\\n]*)*"?s2   (\b[rRuU])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?s2   (\b[rRuU])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?t   STRINGR   t   SYNCs   \n(   R   t   keywordt   kwlistt   dirt   __builtin__t
   startswitht   str(   t   kwt   _[1]R   t   builtinlistt   builtint   commentt   sqstringt   dqstringt	   sq3stringt	   dq3stringt   string(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyt   make_pat   s    *s   \s+(\w+)s   .*?\b(as)\bt   ColorDelegatorc           B   s˜   e  Z d  „  Z d „  Z d „  Z d „  Z d d „ Z d d „ Z d Z	 e
 Z e Z d d „ Z d Z d d „ Z d „  Z d	 „  Z d
 „  Z d „  Z RS(   c         C   s6   t  i |  ƒ t |  _ t |  _ t |  _ |  i ƒ  d  S(   N(   R   t   __init__t   progt   idprogt   asprogt   LoadTagDefs(   t   self(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyR!   %   s
    			c         C   ss   |  i  d  j	 o |  i d ƒ n t i |  | ƒ | d  j	 o1 |  i ƒ  |  i d |  i ƒ |  i d d ƒ n d  S(   Ns   <<toggle-auto-coloring>>s   1.0t   end(	   t   delegatet   Nonet   unbindR   t   setdelegatet   config_colorst   bindt   toggle_colorize_eventt   notify_range(   R&   R(   (    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyR+   ,   s    
c         C   sL   x8 |  i  i ƒ  D]' \ } } | o |  i | |  q q W|  i d ƒ d  S(   Nt   sel(   t   tagdefst   itemst   tag_configuret	   tag_raise(   R&   t   tagt   cnf(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyR,   5   s
     c         C   sû   t  i d d d ƒ } h
 t  i | d ƒ d 6t  i | d ƒ d 6t  i | d ƒ d	 6t  i | d
 ƒ d 6t  i | d ƒ d 6h d  d 6d  d 6d 6h d  d 6d  d 6d 6t  i | d ƒ d 6t  i | d ƒ d 6t  i | d ƒ d 6|  _ t o d G|  i GHn d  S(   Nt   maint   ThemeR   R   R   R   R	   R   R   R   R   t
   definitiont
   DEFINITIONt
   backgroundt
   foregroundR   t   TODOt   breakt   BREAKt   errort   ERRORt   hitR1   (   R   t	   GetOptiont   GetHighlightR)   R1   t   DEBUG(   R&   t   theme(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyR%   ;   s     c         C   sG   |  i  | ƒ } |  i i | | | ƒ |  i | | d t | ƒ ƒ d  S(   Ns   +%dc(   t   indexR(   t   insertR/   t   len(   R&   RG   t   charst   tags(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyRH   M   s    c         C   s3   |  i  | ƒ } |  i i | | ƒ |  i | ƒ d  S(   N(   RG   R(   t   deleteR/   (   R&   t   index1t   index2(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyRL   R   s    c         C   s“   |  i  d | | ƒ |  i o t o	 d GHn d  S|  i o t |  _ t o	 d GHqY n |  i o, t o	 d GHn |  i d |  i ƒ |  _ n d  S(   NR=   s   colorizing already scheduleds   stop colorizings   schedule colorizingi   (	   t   tag_addt   after_idRE   t
   colorizingt   Truet   stop_colorizingt   allow_colorizingt   aftert
   recolorize(   R&   RM   RN   (    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyR/   [   s    
 	
	 
 	c         C   s   |  i  o3 |  i  } d  |  _  t o	 d GHn |  i | ƒ n t |  _ t |  _ | o% |  i p | i	 ƒ  q{ | |  _
 n d  S(   Ns   cancel scheduled recolorizer(   RP   R)   RE   t   after_cancelt   FalseRT   RR   RS   RQ   t   destroyt   close_when_done(   R&   RZ   RP   (    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyt   closei   s    
		 			
c         C   sÕ   |  i  o3 |  i  } d  |  _  t o	 d GHn |  i | ƒ n |  i o' |  i o t o	 d GHn t |  _ n |  i |  _ |  i o' |  i o |  i d |  i	 ƒ |  _  n t o d G|  i o d p d GHn d S(   Ns   cancel scheduled recolorizers   stop colorizingi   s   auto colorizing turnedt   ont   offR>   (
   RP   R)   RE   RW   RT   RQ   RR   RS   RU   RV   (   R&   t   eventRP   (    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyR.   w   s"    
		 	 	c         C   sJ  d  |  _ |  i p t o	 d GHn d  S|  i p t o	 d GHn d  S|  i o t o	 d GHn d  Sz` t |  _ t |  _ t o	 d GHn t	 i
 ƒ  } |  i ƒ  t	 i
 ƒ  } t o d | | GHn Wd  t |  _ X|  i o? |  i d d ƒ o, t o	 d GHn |  i d	 |  i ƒ |  _ n |  i o  |  i } d  |  _ | i ƒ  n d  S(
   Ns   no delegates   auto colorizing is offs   already colorizings   colorizing...s   %.3f secondsR=   s   1.0s   reschedule colorizingi   (   R)   RP   R(   RE   RT   RQ   RX   RS   RR   t   timet   clockt   recolorize_maint   tag_nextrangeRU   RV   RZ   RY   (   R&   t   t0t   t1t   top(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyRV   ˆ   s@    	
 	
 	
 			 	
 
 	
		c      	   C   so  d } xbt  oZ|  i d | ƒ } | p Pn | \ } } |  i d | | ƒ |  i d | ƒ } | o | d } n d } d } | } d } t } xÑ| pÉ| } |  i | d | ƒ } t | d d ƒ } d |  i | d	 ƒ j } |  i | | ƒ }	 |	 p d  Sx* |  i	 i
 ƒ  D] }
 |  i |
 | | ƒ qW| |	 } |  i i | ƒ } xž| o–xt| i ƒ  i ƒ  D]`\ } } | oM| i | ƒ \ } } |  i | | d
 | | d
 | ƒ | d j o\ |  i i | | ƒ } | o< | i d ƒ \ } } |  i d | d
 | | d
 | ƒ qÅqÉ| d j o› d | j o | i d ƒ } n t | ƒ } xl t  o` |  i i | | | ƒ } | p Pn | i d ƒ \ } } |  i d | d
 | | d
 | ƒ qYWqÉqiqiW|  i i | | i ƒ  ƒ } qOWd |  i | d	 ƒ j o | } d } n t } | p |  i d | ƒ n |  i ƒ  |  i o t o	 d GHn d  Sq• Wq	 Wd  S(   Ns   1.0R=   R   i   t    s   +%d lines linestarti   id   s   -1cs   +%dct   deft   classR:   t   importt   #R	   s   colorizing stopped(   s   defs   class(   RR   Rb   t
   tag_removet   tag_prevrangeRX   RG   t   mint	   tag_namest   getR1   t   keysR"   t   searcht	   groupdictR2   t   spanRO   R#   t   matchRI   R$   R'   t   updateRS   RE   (   R&   t   nextt   itemt   headt   tailRJ   t   lines_to_gett   okt   markt   lineR5   t   mt   keyt   valuet   at   bt   m1t   endpos(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyRa   ¥   s       
  		 	  


 	c         C   s1   x* |  i  i ƒ  D] } |  i | d d ƒ q Wd  S(   Ns   1.0R'   (   R1   Rp   Rk   (   R&   R5   (    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyt   removecolorsö   s     N(   t   __name__t
   __module__R!   R+   R,   R%   R)   RH   RL   RP   RR   RT   RX   RQ   R/   RZ   R[   R.   RV   Ra   R…   (    (    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyR    #   s    								Qc          C   s‹   d d k  l  }  t ƒ  } | i d | i ƒ t d d ƒ } | i d d d d	 ƒ | i ƒ  |  | ƒ } t ƒ  } | i | ƒ | i	 ƒ  d  S(
   Niÿÿÿÿ(   t
   Percolatort   WM_DELETE_WINDOWR;   t   whitet   expandi   t   fillt   both(
   Rˆ   t   Tkt   wm_protocolt   quitt   Textt   packt	   focus_setR    t   insertfiltert   mainloop(   Rˆ   t   roott   textt   pt   d(    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyR7   ú   s    	
	t   __main__(   R_   t   reR   R   t   TkinterR   t   configHandlerR   RX   RE   R   R   t   compilet   SR"   R#   R$   R    R7   R†   (    (    (    s8   C:\graphics\Tools\python26\lib\idlelib\ColorDelegator.pyt   <module>   s    
		×	