ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     
{fc           @   s   d  Z  d d l m Z d d l m Z i d d 6d d 6d d	 6Z d
 Z d d d     YZ e d k r d d l	 Z	 e	 j
 d d d n  d S(   s   ParenMatch -- An IDLE extension for parenthesis matching.

When you hit a right paren, the cursor should move briefly to the left
paren.  Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
i(   t   HyperParser(   t   idleConft   (t   )t   [t   ]t   {t   }id   t
   ParenMatchc           B   s  e  Z d  Z d d# g f g Z e j d d d d d Z e j d d d	 d
 d d d Z e j e j	   d  Z
 e j d d d d
 d d d Z d Z d$ Z d   Z d   Z d   Z d   Z d   Z d   Z d% d  Z d   Z d   Z d   Z d    Z d!   Z d"   Z RS(&   s  Highlight matching parentheses

    There are three supported style of paren matching, based loosely
    on the Emacs options.  The style is select based on the
    HILITE_STYLE attribute; it can be changed used the set_style
    method.

    The supported styles are:

    default -- When a right paren is typed, highlight the matching
        left paren for 1/2 sec.

    expression -- When a right paren is typed, highlight the entire
        expression from the left paren to the right paren.

    TODO:
        - extend IDLE with configuration dialog to change options
        - implement rest of Emacs highlight styles (see below)
        - print mismatch warning in IDLE status window

    Note: In Emacs, there are several styles of highlight where the
    matching paren is highlighted whenever the cursor is immediately
    to the right of a right paren.  I don't know how to do that in Tk,
    so I haven't bothered.
    t   edits   Show surrounding parenss   <<flash-paren>>t
   extensionsR   t   stylet   defaultt
   expressions   flash-delayt   typet   inti  t   hilitet   bellt   booli   s   <<parenmatch-check-restore>>s
   <KeyPress>s   <ButtonPress>s   <Key-Return>s   <Key-BackSpace>c         C   sT   | |  _  | j |  _ | j j |  j |  j  d |  _ d |  _ |  j |  j  d  S(   Ni    (	   t   editwint   textt   bindt   RESTORE_VIRTUAL_EVENT_NAMEt   restore_eventt   countert   is_restore_activet	   set_stylet   STYLE(   t   selfR   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyt   __init__;   s    	
		c         C   sC   |  j  s? x' |  j D] } |  j j |  j |  q Wt |  _  n  d  S(   N(   R   t   RESTORE_SEQUENCESR   t	   event_addR   t   True(   R   t   seq(    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyt   activate_restoreG   s    	c         C   sC   |  j  r? x' |  j D] } |  j j |  j |  q Wt |  _  n  d  S(   N(   R   R   R   t   event_deleteR   t   False(   R   R!   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyt   deactivate_restoreM   s    	c         C   s[   | |  _  | d k r0 |  j |  _ |  j |  _ n' | d k rW |  j |  _ |  j |  _ n  d  S(   NR   R   (   R   t   create_tag_defaultt
   create_tagt   set_timeout_lastt   set_timeoutt   create_tag_expressiont   set_timeout_none(   R   R   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyR   S   s    	c         C   sW   t  |  j d  j   } | d  k r2 |  j   d  S|  j   |  j |  |  j   d  S(   Nt   insert(   R    R   t   get_surrounding_bracketst   Nonet   warn_mismatchedR"   R'   R(   (   R   t   eventt   indices(    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyt   flash_paren_event\   s    

c         C   s   |  j  j d  } | t k r" d  St |  j d  } | j   sD d  S| j t | t  } | d  k rt |  j	   d  S|  j
   |  j |  |  j   d  S(   Ns	   insert-1c(   R   t   gett   _openersR    R   t
   is_in_codeR-   R    R.   R/   R"   R'   R)   (   R   R0   t   closert   hpR1   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyt   paren_closed_eventf   s    

c         C   s-   |  j  j d  |  j   |  j d 7_ d  S(   Nt   pareni   (   R   t
   tag_deleteR%   R   (   R   R0   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyR   v   s    
c         C   s    | |  j  k r |  j   n  d  S(   N(   R   R   (   R   t   timer_count(    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyt   handle_restore_timer{   s    c         C   s   |  j  r |  j j   n  d  S(   N(   t   BELLR   R   (   R   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyR/      s    	c         C   s1   |  j  j d | d  |  j  j d |  j  d S(   s'   Highlight the single paren that matchesR9   i    N(   R   t   tag_addt
   tag_configt   HILITE_CONFIG(   R   R1   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyR&      s    c         C   sk   |  j  j | d  d	 k r- | d d } n
 | d } |  j  j d | d |  |  j  j d |  j  d S(
   s   Highlight the entire expressioni   R   R   R   s   +1cR9   i    N(   R   R   R   (   R   R3   R>   R?   R@   (   R   R1   t
   rightindex(    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyR*      s
    
c         C   sM   |  j  d 7_  |  |  j  |  j j d  d  } |  j j j t | |  d S(   sS   Highlight will remain until user input turns it off
        or the insert has movedi   R,   c         S   sE   | | j  j d  k r( | j |  n | j j j t |  |   d  S(   NR,   (   R   t   indexR<   R   t
   text_framet   aftert   CHECK_DELAY(   t   callmeR   t   cRB   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyRF      s    N(   R   R   RB   R   RC   RD   RE   (   R   RF   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyR+      s    	c         C   s8   |  j  d 7_  |  j j j |  j |  |  j  d   d S(   s7   The last highlight created will be removed after .5 seci   c         S   s   |  j  |  S(   N(   R<   (   R   RG   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyt   <lambda>   t    N(   R   R   RC   RD   t   FLASH_DELAY(   R   (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyR(      s    (   s   Show surrounding parenss   <<flash-paren>>(   s
   <KeyPress>s   <ButtonPress>s   <Key-Return>s   <Key-BackSpace>N(   t   __name__t
   __module__t   __doc__t   menudefsR   t	   GetOptionR   RJ   t   GetHighlightt   CurrentThemeR@   R=   R   R   R   R"   R%   R   R2   R8   R.   R   R<   R/   R&   R*   R+   R(   (    (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyR      s4   	 						
						t   __main__Ns!   idlelib.idle_test.test_parenmatcht	   verbosityi   (    (   RM   t   idlelib.HyperParserR    t   idlelib.configHandlerR   R4   RE   R   RK   t   unittestt   main(    (    (    s*   /usr/lib64/python2.7/idlelib/ParenMatch.pyt   <module>   s   