£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>

f  c               @   s^   d  Z  d d l m Z d d l m Z i d d 6d d 6d d	 6Z d
 Z Gd d   d  Z d S(   u   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    (   u   HyperParser(   u   idleConfu   (u   )u   [u   ]u   {u   }id   c             B   sL  |  Ee  Z d  Z d Z d d1 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 d2 Z d d   Z d d   Z d d   Z d d   Z d d   Z d  d!   Z d0 d" d#  Z d$ d%   Z d& d'   Z d( d)   Z d* d+   Z d, d-   Z d. d/   Z d0 S(3   u
   ParenMatchu  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.
    u   editu   Show surrounding parensu   <<flash-paren>>u
   extensionsu   styleu   defaultu
   expressionu   flash-delayu   typeu   inti  u   hiliteu   bellu   booli   u   <<parenmatch-check-restore>>u
   <KeyPress>u   <ButtonPress>u   <Key-Return>u   <Key-BackSpace>c             C   sT   | |  _  | j |  _ | j j |  j |  j  d |  _ d |  _ |  j |  j  d  S(   Ni    (	   u   editwinu   textu   bindu   RESTORE_VIRTUAL_EVENT_NAMEu   restore_eventu   counteru   is_restore_activeu	   set_styleu   STYLE(   u   selfu   editwin(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   __init__;   s    	
		u   ParenMatch.__init__c             C   sC   |  j  s? x' |  j D] } |  j j |  j |  q Wd |  _  n  d  S(   NT(   u   is_restore_activeu   RESTORE_SEQUENCESu   textu	   event_addu   RESTORE_VIRTUAL_EVENT_NAMEu   True(   u   selfu   seq(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   activate_restoreG   s    	u   ParenMatch.activate_restorec             C   sC   |  j  r? x' |  j D] } |  j j |  j |  q Wd |  _  n  d  S(   NF(   u   is_restore_activeu   RESTORE_SEQUENCESu   textu   event_deleteu   RESTORE_VIRTUAL_EVENT_NAMEu   False(   u   selfu   seq(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   deactivate_restoreM   s    	u   ParenMatch.deactivate_restorec             C   s[   | |  _  | d k r0 |  j |  _ |  j |  _ n' | d k rW |  j |  _ |  j |  _ n  d  S(   Nu   defaultu
   expression(   u   STYLEu   create_tag_defaultu
   create_tagu   set_timeout_lastu   set_timeoutu   create_tag_expressionu   set_timeout_none(   u   selfu   style(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu	   set_styleS   s    	u   ParenMatch.set_stylec             C   sW   t  |  j d  j   } | d  k r2 |  j   d  S|  j   |  j |  |  j   d  S(   Nu   insert(   u   HyperParseru   editwinu   get_surrounding_bracketsu   Noneu   warn_mismatchedu   activate_restoreu
   create_tagu   set_timeout_last(   u   selfu   eventu   indices(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   flash_paren_event\   s    

u   ParenMatch.flash_paren_eventc             C   s   |  j  j d  } | t k r" d  St |  j d  } | j   sD d  S| j t | d  } | d  k rt |  j	   d  S|  j
   |  j |  |  j   d  S(   Nu	   insert-1cT(   u   textu   getu   _openersu   HyperParseru   editwinu
   is_in_codeu   get_surrounding_bracketsu   Trueu   Noneu   warn_mismatchedu   activate_restoreu
   create_tagu   set_timeout(   u   selfu   eventu   closeru   hpu   indices(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   paren_closed_evente   s    

u   ParenMatch.paren_closed_eventc             C   s-   |  j  j d  |  j   |  j d 7_ d  S(   Nu   pareni   (   u   textu
   tag_deleteu   deactivate_restoreu   counter(   u   selfu   event(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   restore_eventu   s    
u   ParenMatch.restore_eventc             C   s    | |  j  k r |  j   n  d  S(   N(   u   counteru   restore_event(   u   selfu   timer_count(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   handle_restore_timerz   s    u   ParenMatch.handle_restore_timerc             C   s   |  j  r |  j j   n  d  S(   N(   u   BELLu   textu   bell(   u   self(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   warn_mismatched~   s    	u   ParenMatch.warn_mismatchedc             C   s1   |  j  j d | d  |  j  j d |  j  d S(   u'   Highlight the single paren that matchesu   pareni    N(   u   textu   tag_addu
   tag_configu   HILITE_CONFIG(   u   selfu   indices(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   create_tag_default   s    u   ParenMatch.create_tag_defaultc             C   sk   |  j  j | d  d	 k r- | d d } n
 | d } |  j  j d | d |  |  j  j d |  j  d S(
   u   Highlight the entire expressioni   u   )u   ]u   }u   +1cu   pareni    N(   u   )u   ]u   }(   u   textu   getu   tag_addu
   tag_configu   HILITE_CONFIG(   u   selfu   indicesu
   rightindex(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   create_tag_expression   s
    
u    ParenMatch.create_tag_expressionc             C   sP   |  j  d 7_  |  |  j  |  j j d  d d  } |  j j j t | |  d S(   uS   Highlight will remain until user input turns it off
        or the insert has movedi   u   insertc             S   sE   | | j  j d  k r( | j |  n | j j j t |  |   d  S(   Nu   insert(   u   textu   indexu   handle_restore_timeru   editwinu
   text_frameu   afteru   CHECK_DELAY(   u   callmeu   selfu   cu   index(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   callme   s    u+   ParenMatch.set_timeout_none.<locals>.callmeN(   u   counteru   textu   indexu   editwinu
   text_frameu   afteru   CHECK_DELAY(   u   selfu   callme(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   set_timeout_none   s    	u   ParenMatch.set_timeout_nonec             C   s;   |  j  d 7_  |  j j j |  j |  |  j  d d   d S(   u7   The last highlight created will be removed after .5 seci   c             S   s   |  j  |  S(   N(   u   handle_restore_timer(   u   selfu   c(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   <lambda>   s    u-   ParenMatch.set_timeout_last.<locals>.<lambda>N(   u   counteru   editwinu
   text_frameu   afteru   FLASH_DELAY(   u   self(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   set_timeout_last   s    u   ParenMatch.set_timeout_lastN(   u   Show surrounding parensu   <<flash-paren>>(   u
   <KeyPress>u   <ButtonPress>u   <Key-Return>u   <Key-BackSpace>(   u   __name__u
   __module__u   __qualname__u   __doc__u   menudefsu   idleConfu	   GetOptionu   STYLEu   FLASH_DELAYu   GetHighlightu   CurrentThemeu   HILITE_CONFIGu   BELLu   RESTORE_VIRTUAL_EVENT_NAMEu   RESTORE_SEQUENCESu   __init__u   activate_restoreu   deactivate_restoreu	   set_styleu   flash_paren_eventu   paren_closed_eventu   Noneu   restore_eventu   handle_restore_timeru   warn_mismatchedu   create_tag_defaultu   create_tag_expressionu   set_timeout_noneu   set_timeout_last(   u
   __locals__(    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu
   ParenMatch   s4   	 		u
   ParenMatchN(   u   __doc__u   idlelib.HyperParseru   HyperParseru   idlelib.configHandleru   idleConfu   _openersu   CHECK_DELAYu
   ParenMatch(    (    (    u7   /opt/alt/python33/lib64/python3.3/idlelib/ParenMatch.pyu   <module>   s
   